Backed out 2 changesets (bug 1673440) for SM Bustages on testPrintError.cpp. CLOSED TREE

Backed out changeset c4448be58fcb (bug 1673440)
Backed out changeset 5a0e794b51bf (bug 1673440)
This commit is contained in:
Razvan Maries 2020-10-27 16:46:54 +02:00
Родитель 5a2adffbe7
Коммит d1cb2cdff6
7 изменённых файлов: 15 добавлений и 38 удалений

Просмотреть файл

@ -78,7 +78,7 @@ add_task(async function() {
execute(hud, `1 + @`);
const messageNode = await waitFor(() =>
findMessage(hud, "illegal character U+0040")
findMessage(hud, "illegal character")
);
is(
messageNode.querySelector(".frames"),

Просмотреть файл

@ -108,7 +108,7 @@ rawPackets.set(`1 + @`, {
"preview": {
"kind": "Error",
"name": "SyntaxError",
"message": "illegal character U+0040",
"message": "illegal character",
"stack": "",
"fileName": "debugger eval code",
"lineNumber": 1,
@ -117,7 +117,7 @@ rawPackets.set(`1 + @`, {
},
"actorID": "server0.conn0.child1/obj26"
},
"exceptionMessage": "SyntaxError: illegal character U+0040",
"exceptionMessage": "SyntaxError: illegal character",
"exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default",
"hasException": true,
"frame": {

Просмотреть файл

@ -288,7 +288,7 @@ MSG_DEF(JSMSG_BAD_ESCAPE, 0, JSEXN_SYNTAXERR, "invalid escape seque
MSG_DEF(JSMSG_MISSING_PRIVATE_NAME, 0, JSEXN_SYNTAXERR, "'#' not followed by identifier")
MSG_DEF(JSMSG_PRIVATE_DELETE, 0, JSEXN_SYNTAXERR, "private fields can't be deleted")
MSG_DEF(JSMSG_MISSING_PRIVATE_DECL, 1, JSEXN_SYNTAXERR, "reference to undeclared private field or method {0}")
MSG_DEF(JSMSG_ILLEGAL_CHARACTER, 1, JSEXN_SYNTAXERR, "illegal character {0}")
MSG_DEF(JSMSG_ILLEGAL_CHARACTER, 0, JSEXN_SYNTAXERR, "illegal character")
MSG_DEF(JSMSG_IMPORT_META_OUTSIDE_MODULE, 0, JSEXN_SYNTAXERR, "import.meta may only appear in a module")
MSG_DEF(JSMSG_IMPORT_DECL_AT_TOP_LEVEL, 0, JSEXN_SYNTAXERR, "import declarations may only appear at top level of a module")
MSG_DEF(JSMSG_OF_AFTER_FOR_LOOP_DECL, 0, JSEXN_SYNTAXERR, "a declaration in the head of a for-of loop can't have an initializer")

Просмотреть файл

@ -36,7 +36,6 @@
#include "frontend/ParserAtom.h"
#include "frontend/ReservedWords.h"
#include "js/CharacterEncoding.h"
#include "js/Printf.h" // JS_smprintf
#include "js/RegExpFlags.h" // JS::RegExpFlags
#include "js/UniquePtr.h"
#include "util/StringBuffer.h"
@ -1830,17 +1829,6 @@ bool TokenStreamSpecific<Unit, AnyCharsAccess>::computeErrorMetadata(
return true;
}
template <typename Unit, class AnyCharsAccess>
void TokenStreamSpecific<Unit, AnyCharsAccess>::reportIllegalCharacter(
int32_t cp) {
UniqueChars display = JS_smprintf("U+%04X", cp);
if (!display) {
ReportOutOfMemory(anyCharsAccess().cx);
return;
}
error(JSMSG_ILLEGAL_CHARACTER, display.get());
}
// We have encountered a '\': check for a Unicode escape sequence after it.
// Return the length of the escape sequence and the encoded code point (by
// value) if we found a Unicode escape sequence, and skip all code units
@ -2847,7 +2835,7 @@ MOZ_MUST_USE bool TokenStreamSpecific<Unit, AnyCharsAccess>::getTokenInternal(
modifier, NameVisibility::Public, ttp);
}
reportIllegalCharacter(cp);
error(JSMSG_ILLEGAL_CHARACTER);
return badToken();
} // !isAsciiCodePoint(unit)
@ -3359,7 +3347,7 @@ MOZ_MUST_USE bool TokenStreamSpecific<Unit, AnyCharsAccess>::getTokenInternal(
// We consumed a bad ASCII code point/unit. Put it back so the
// error location is the bad code point.
ungetCodeUnit(unit);
reportIllegalCharacter(unit);
error(JSMSG_ILLEGAL_CHARACTER);
return badToken();
} // switch (AssertedCast<uint8_t>(CodeUnitValue(toUnit(unit))))

Просмотреть файл

@ -2565,8 +2565,6 @@ class MOZ_STACK_CLASS TokenStreamSpecific
}
}
void reportIllegalCharacter(int32_t cp);
MOZ_MUST_USE bool putIdentInCharBuffer(const Unit* identStart);
using IsIntegerUnit = bool (*)(int32_t);

Просмотреть файл

@ -1,20 +1,14 @@
load(libdir + "syntax.js");
function check_syntax_error_at(e, code, name) {
assertEq(e instanceof SyntaxError, true, name + ": " + code);
assertEq(e.message, "illegal character U+0040", name + ": " + code);
}
test_syntax(["@"], check_syntax_error_at, false);
var JSMSG_ILLEGAL_CHARACTER = "illegal character";
function check_syntax_error_ellipsis(e, code, name) {
assertEq(e instanceof SyntaxError, true, name + ": " + code);
assertEq(e.message, "illegal character U+2026", name + ": " + code);
}
test_syntax(["…"], check_syntax_error_ellipsis, false);
var postfixes = [
"@",
];
function check_syntax_error_clown(e, code, name) {
function check_syntax_error(e, code, name) {
assertEq(e instanceof SyntaxError, true, name + ": " + code);
assertEq(e.message, "illegal character U+1F921", name + ": " + code);
assertEq(e.message, JSMSG_ILLEGAL_CHARACTER, name + ": " + code);
}
test_syntax(["🤡"], check_syntax_error_clown, false);
test_syntax(postfixes, check_syntax_error, false);

Просмотреть файл

@ -31,18 +31,15 @@ function test()
for (var i = 0; i < formatcontrolchars.length; i++)
{
var char = formatcontrolchars[i];
try
{
eval("hi" + char + "there = 'howdie';");
eval("hi" + formatcontrolchars[i] + "there = 'howdie';");
}
catch(ex)
{
actual = ex + '';
}
var hex = char.codePointAt(0).toString(16).toUpperCase().padStart(4, '0');
reportCompare(`${expect} U+${hex}`, actual, summary + ': ' + i);
reportCompare(expect, actual, summary + ': ' + i);
}
}