Fixing bug 256621: throw \n 1 is not allowed per ECMA 262

This commit is contained in:
igor%mir2.org 2004-08-23 23:01:00 +00:00
Родитель 4407874e10
Коммит 877212964d
2 изменённых файлов: 19 добавлений и 10 удалений

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

@ -931,6 +931,12 @@ public class Parser
case Token.THROW: {
consumeToken();
if (peekTokenOrEOL(TokenStream.TSF_REGEXP) == Token.EOL) {
// ECMAScript does not allow new lines before throw expression,
// see bug 256617
reportError("msg.bad.throw.eol");
}
int lineno = ts.getLineno();
decompiler.addToken(Token.THROW);
pn = nf.createThrow(expr(false), lineno);

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

@ -224,34 +224,37 @@ msg.bad.backref =\
msg.bad.regexp.compile =\
Only one argument may be specified if the first argument to \
RegExp.prototype.compile is a RegExp object
RegExp.prototype.compile is a RegExp object.
# Compilation API
# Parser
msg.got.syntax.errors = \
Compilation produced {0} syntax errors.
# NodeTransformer
msg.dup.label =\
Duplicate label.
duplicatet label
msg.undef.label =\
Undefined label.
undefined labe
msg.bad.break =\
Unlabelled break must be inside loop or switch.
unlabelled break must be inside loop or switch
msg.continue.outside =\
continue must be inside loop.
continue must be inside loop
msg.continue.nonloop =\
Can only continue to labeled iteration statement.
continue can only use labeles of iteration statements
msg.fn.redecl =\
Function "{0}" redeclared; prior definition will be ignored.
function "{0}" redeclared; prior definition will be ignored
msg.bad.throw.eol =\
Line terminator is not allowed between the throw keyword and throw \
expression.
# Parser
msg.no.paren.parms =\
missing ( before function parameters
missing ( before function parameters.
msg.no.parm =\
missing formal parameter