Bug 950527 - Mark asm.js success messages as not being an error (r=bbouvier)

This commit is contained in:
Luke Wagner 2013-12-16 10:20:35 -06:00
parent 23f5fa315e
commit 6fc38765da
2 changed files with 1 additions and 33 deletions

View File

@ -107,38 +107,6 @@ assertTypeFailInEval('function f(global, {imports}) { "use asm"; function g() {}
assertTypeFailInEval('function f(g = 2) { "use asm"; function g() {} return g }');
assertTypeFailInEval('function *f() { "use asm"; function g() {} return g }');
function assertLinkFailInEval(str)
{
if (!isAsmJSCompilationAvailable())
return;
var caught = false;
var oldOpts = options("werror");
assertEq(oldOpts.indexOf("werror"), -1);
try {
eval(str);
} catch (e) {
assertEq((''+e).indexOf(ASM_OK_STRING) == -1, false);
caught = true;
}
assertEq(caught, true);
options("werror");
var code = eval(str);
var caught = false;
var oldOpts = options("werror");
assertEq(oldOpts.indexOf("werror"), -1);
try {
code.apply(null, Array.slice(arguments, 1));
} catch (e) {
caught = true;
}
assertEq(caught, true);
options("werror");
}
assertLinkFailInEval('(function(global) { "use asm"; var im=global.Math.imul; function g() {} return g })');
assertThrowsInstanceOf(function() { new Function(USE_ASM + 'var)') }, SyntaxError);
assertThrowsInstanceOf(function() { new Function(USE_ASM + 'return)') }, SyntaxError);
assertThrowsInstanceOf(function() { new Function(USE_ASM + 'var z=-2w') }, SyntaxError);

View File

@ -391,7 +391,7 @@ MSG_DEF(JSMSG_DATE_NOT_FINITE, 337, 0, JSEXN_RANGEERR, "date value is not
MSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 338, 0, JSEXN_SYNTAXERR, "\"use asm\" is only meaningful in the Directive Prologue of a function body")
MSG_DEF(JSMSG_USE_ASM_TYPE_FAIL, 339, 1, JSEXN_TYPEERR, "asm.js type error: {0}")
MSG_DEF(JSMSG_USE_ASM_LINK_FAIL, 340, 1, JSEXN_TYPEERR, "asm.js link error: {0}")
MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 341, 1, JSEXN_ERR, "successfully compiled asm.js code ({0})")
MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 341, 1, JSEXN_NONE, "Successfully compiled asm.js code ({0})")
MSG_DEF(JSMSG_BAD_ARROW_ARGS, 342, 0, JSEXN_SYNTAXERR, "invalid arrow-function arguments (parentheses around the arrow-function may help)")
MSG_DEF(JSMSG_YIELD_IN_ARROW, 343, 0, JSEXN_SYNTAXERR, "arrow function may not contain yield")
MSG_DEF(JSMSG_WRONG_VALUE, 344, 2, JSEXN_ERR, "expected {0} but found {1}")