Bug 1526694 [wpt PR 15276] - [wasm] update js-api test runner and expectations, a=testonly
authorSven Sauleau <ssauleau@igalia.com>
Tue, 05 Mar 2019 12:19:31 +0000
changeset 464594 4459ceba3a05
parent 464593 578acd858f71
child 464595 13b19dc8a8f2
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526694, 15276, 926311, 1458099, 633121
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526694 [wpt PR 15276] - [wasm] update js-api test runner and expectations, a=testonly Automatic update from web-platform-tests [wasm] update js-api test runner and expectations wasm-module-builder: - consistently adds the end opcode in function bodies (using addBody). - add missing setTableLength method table/get-set: - Avoid unrelated errors like: Cannot destructure property `fn` of 'undefined' or 'null'. Bug: 926311, v8:8319 Change-Id: Ia7db1ee5c3a9b1c1d6092cdce8885ddee4dd9b0e Reviewed-on: https://chromium-review.googlesource.com/c/1458099 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Sven Sauleau <ssauleau@igalia.com> Cr-Commit-Position: refs/heads/master@{#633121} -- wpt-commits: 22400f9755a49a50632a8f2067cb06bca74efff8 wpt-pr: 15276
testing/web-platform/tests/wasm/jsapi/table/get-set.any.js
testing/web-platform/tests/wasm/jsapi/wasm-module-builder.js
--- a/testing/web-platform/tests/wasm/jsapi/table/get-set.any.js
+++ b/testing/web-platform/tests/wasm/jsapi/table/get-set.any.js
@@ -1,14 +1,14 @@
 // META: global=jsshell
 // META: script=/wasm/jsapi/wasm-constants.js
 // META: script=/wasm/jsapi/wasm-module-builder.js
 // META: script=assertions.js
 
-let functions;
+let functions = {};
 setup(() => {
   const builder = new WasmModuleBuilder();
 
   builder
     .addFunction("fn", kSig_v_d)
     .addBody([])
     .exportFunc();
   builder
--- a/testing/web-platform/tests/wasm/jsapi/wasm-module-builder.js
+++ b/testing/web-platform/tests/wasm/jsapi/wasm-module-builder.js
@@ -93,16 +93,22 @@ class WasmFunctionBuilder {
   }
 
   exportFunc() {
     this.exportAs(this.name);
     return this;
   }
 
   addBody(body) {
+    const bodyCopy = body.slice();
+    bodyCopy.push(kExprEnd);
+    return this.addBodyWithEnd(bodyCopy);
+  }
+
+  addBodyWithEnd(body) {
     this.body = body;
     return this;
   }
 
   addLocals(locals) {
     this.locals = locals;
     return this;
   }
@@ -257,16 +263,21 @@ class WasmModuleBuilder {
     return this;
   }
 
   // TODO(ssauleau): legacy, remove this
   setFunctionTableLength(length) {
     return this.setTableBounds(length);
   }
 
+  // TODO(ssauleau): legacy, remove this
+  setTableLength(min, max = undefined) {
+    return this.setTableBounds(min, max);
+  }
+
   toArray(debug = false) {
     let binary = new Binary;
     let wasm = this;
 
     // Add header
     binary.emit_header();
 
     // Add type section