Bug 1615718. Improve JSMSG_MORE_ARGS_NEEDED to make it easier to parse out what needed more args. r=jorendorff
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 18 Feb 2020 17:32:57 +0000
changeset 514438 8be52303d2c3f9f763badebf4fa6deab67d79914
parent 514437 12c2555ba296a9887cddf2161e1d9d91c1a27fb9
child 514439 56fe3e1126006f223e26db884b38195f5239c5fa
push id107596
push userbzbarsky@mozilla.com
push dateTue, 18 Feb 2020 17:33:56 +0000
treeherderautoland@8be52303d2c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1615718
milestone75.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 1615718. Improve JSMSG_MORE_ARGS_NEEDED to make it easier to parse out what needed more args. r=jorendorff Also gets rid of a 'were' that looked weird when 1 arg was passed. Differential Revision: https://phabricator.services.mozilla.com/D62961
js/src/jit-test/tests/wasm/validate.js
js/src/js.msg
--- a/js/src/jit-test/tests/wasm/validate.js
+++ b/js/src/jit-test/tests/wasm/validate.js
@@ -1,11 +1,11 @@
 const { validate } = WebAssembly;
 
-assertErrorMessage(() => validate(), Error, /requires at least 1 argument/);
+assertErrorMessage(() => validate(), Error, /At least 1 argument required/);
 
 const argError = /first argument must be an ArrayBuffer or typed array object/;
 assertErrorMessage(() => validate(null), Error, argError);
 assertErrorMessage(() => validate(true), Error, argError);
 assertErrorMessage(() => validate(42), Error, argError);
 assertErrorMessage(() => validate(NaN), Error, argError);
 assertErrorMessage(() => validate('yo'), Error, argError);
 assertErrorMessage(() => validate([]), Error, argError);
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -36,17 +36,17 @@
  *
  * to report:
  *
  * "TypeError: Rhino is not a member of the Monkey family"
  */
 
 MSG_DEF(JSMSG_NOT_AN_ERROR,            0, JSEXN_ERR, "<Error #0 is reserved>")
 MSG_DEF(JSMSG_NOT_DEFINED,             1, JSEXN_REFERENCEERR, "{0} is not defined")
-MSG_DEF(JSMSG_MORE_ARGS_NEEDED,        4, JSEXN_TYPEERR, "{0} requires at least {1} argument{2}, but only {3} were passed")
+MSG_DEF(JSMSG_MORE_ARGS_NEEDED,        4, JSEXN_TYPEERR, "{0}: At least {1} argument{2} required, but only {3} passed")
 MSG_DEF(JSMSG_INCOMPATIBLE_PROTO,      3, JSEXN_TYPEERR, "{0}.prototype.{1} called on incompatible {2}")
 MSG_DEF(JSMSG_NO_CONSTRUCTOR,          1, JSEXN_TYPEERR, "{0} has no constructor")
 MSG_DEF(JSMSG_BAD_SORT_ARG,            0, JSEXN_TYPEERR, "invalid Array.prototype.sort argument")
 MSG_DEF(JSMSG_READ_ONLY,               1, JSEXN_TYPEERR, "{0} is read-only")
 MSG_DEF(JSMSG_CANT_DELETE,             1, JSEXN_TYPEERR, "property {0} is non-configurable and can't be deleted")
 MSG_DEF(JSMSG_CANT_TRUNCATE_ARRAY,     0, JSEXN_TYPEERR, "can't delete non-configurable array element")
 MSG_DEF(JSMSG_NOT_FUNCTION,            1, JSEXN_TYPEERR, "{0} is not a function")
 MSG_DEF(JSMSG_NOT_CONSTRUCTOR,         1, JSEXN_TYPEERR, "{0} is not a constructor")