Bug 1635783 - Make an error message match more flexible. r=rhunt
authorLars T Hansen <lhansen@mozilla.com>
Mon, 11 May 2020 08:30:06 +0000
changeset 529283 d4756b84d2d52774ce2b93e61774a4aa9c8dde78
parent 529282 af5b7413b76209816f665a17dbd231167bf79912
child 529284 ec2d66612ed02cfb1e458f8780ba3aaf8777e28a
push id37406
push userdluca@mozilla.com
push dateTue, 12 May 2020 09:34:21 +0000
treeherdermozilla-central@1706d4d54ec6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1635783
milestone78.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 1635783 - Make an error message match more flexible. r=rhunt When SIMD is not enabled, v128 is not mentioned in the error message, so make allowances for that. Differential Revision: https://phabricator.services.mozilla.com/D74220
js/src/jit-test/tests/wasm/ion-error-i64.js
--- a/js/src/jit-test/tests/wasm/ion-error-i64.js
+++ b/js/src/jit-test/tests/wasm/ion-error-i64.js
@@ -27,17 +27,17 @@ var instance = wasmEvalText(`(module
      local.get 1
      i64.add
     )
 )`).exports;
 
 (function() {
     // In ion-eager mode, make sure we don't try to inline a function that
     // takes or returns i64 arguments.
-    assertErrorMessage(() => instance.add_two_i64(0n, 1n), TypeError, /cannot pass i64 or v128 to or from JS/);
+    assertErrorMessage(() => instance.add_two_i64(0n, 1n), TypeError, /cannot pass i64( or v128)? to or from JS/);
 })();
 
 enableGeckoProfiling();
 
 var callToMain;
 
 function main() {
     var arrayCallLine = nextLineNumber(13);
@@ -64,17 +64,17 @@ function main() {
             assertEqPreciseStacks(profilingStack, [
                 // Error stack: control flow is redirected to a builtin thunk
                 // then calling into C++ from the wasm entry before jumping to
                 // the wasm jit entry exception handler.
                 ['', '>', '<,>', 'i64>,>', '<,>', '>', ''],
                 [''] // the jit path wasn't taken (interpreter/baseline only).
             ]);
 
-            assertEq(caught.message, 'cannot pass i64 or v128 to or from JS');
+            assertEq(!!caught.message.match(/cannot pass i64( or v128)? to or from JS/), true);
 
             let stack = caught.stack.split('\n');
 
             // Which callsites appear on the error stack.
             let callsites = stack.map(s => s.split('@')[0]);
             assertEq(callsites[0], 'main');
             assertEq(callsites[1], ''); // global scope