From 87fa27b4560c47638b1719ce5fa858d51e564583 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 15 Feb 2023 16:39:59 -0800 Subject: [PATCH] [js-api] Rename variables to be consistent (NFC) This renames variables to be consistent among exception JS API tests. Now `WebAssembly.Tag`s are named `tag` or prefixed with it and `WebAssembly.Exception`s are named `exn` or prefixed with it. Currently some `WebAssembly.Tag`s are named `exn` because `Tag` was used to call `Exception` in the earlier version of the JS API, which this PR fixes. --- test/js-api/exception/constructor.tentative.any.js | 8 ++++---- test/js-api/exception/toString.tentative.any.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/js-api/exception/constructor.tentative.any.js b/test/js-api/exception/constructor.tentative.any.js index 0fd47b45..7ad08e18 100644 --- a/test/js-api/exception/constructor.tentative.any.js +++ b/test/js-api/exception/constructor.tentative.any.js @@ -18,8 +18,8 @@ test(() => { }, "No arguments"); test(() => { - const argument = new WebAssembly.Tag({ parameters: [] }); - assert_throws_js(TypeError, () => WebAssembly.Exception(argument)); + const tag = new WebAssembly.Tag({ parameters: [] }); + assert_throws_js(TypeError, () => WebAssembly.Exception(tag)); }, "Calling"); test(() => { @@ -53,10 +53,10 @@ test(() => { ["i64", undefined], ]; for (const typeAndArg of typesAndArgs) { - const exn = new WebAssembly.Tag({ parameters: [typeAndArg[0]] }); + const tag = new WebAssembly.Tag({ parameters: [typeAndArg[0]] }); assert_throws_js( TypeError, - () => new WebAssembly.Exception(exn, typeAndArg[1]) + () => new WebAssembly.Exception(tag, typeAndArg[1]) ); } }, "Invalid exception argument"); diff --git a/test/js-api/exception/toString.tentative.any.js b/test/js-api/exception/toString.tentative.any.js index 52635186..00e801a6 100644 --- a/test/js-api/exception/toString.tentative.any.js +++ b/test/js-api/exception/toString.tentative.any.js @@ -3,8 +3,8 @@ test(() => { const argument = { parameters: [] }; const tag = new WebAssembly.Tag(argument); - const exception = new WebAssembly.Exception(tag, []); - assert_class_string(exception, "WebAssembly.Exception"); + const exn = new WebAssembly.Exception(tag, []); + assert_class_string(exn, "WebAssembly.Exception"); }, "Object.prototype.toString on an Exception"); test(() => {