Changeset 10646 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 28, 2005, 11:51:15 AM (20 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r10641 r10646 1 2005-09-27 Darin Adler <[email protected]> 2 3 Reviewed by Maciej. 4 5 - update grammar to fix conflicts; fixes one of our test cases 6 because it resolves the relationship between function expressions 7 and declarations in the way required by the ECMA specification 8 9 * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts. 10 A new set of rules for "no bracket or function at start of expression" and 11 another set of rules for "no in anywhere in expression". Also simplified the 12 handling of try to use only a single node and used operator precedence to 13 get rid of the conflict in handling of if and else. Also used a macro to 14 streamline the handling of automatic semicolons and changed parenthesis 15 handling to use a virtual function. 16 17 * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement. 18 (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead 19 of using a special node for each. 20 * kjs/nodes.cpp: 21 (Node::createErrorCompletion): Added. Used instead of throwError when creating errors 22 that should not be in a completion rather than an ExecState. 23 (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it 24 replaces. 25 (Node::nodeInsideAllParens): Added. 26 (GroupNode::nodeInsideAllParens): Added. 27 (StatListNode::execute): Removed code to move exceptions into completion objects; 28 that's now done solely by the KJS_CHECKEXCEPTION macro. 29 (TryNode::execute): Include execution of catch and finally here rather than using 30 separate nodes. 31 (FuncDeclNode::execute): Moved here, no longer inline. 32 * kjs/nodes2string.cpp: 33 (TryNode::streamTo): Updated for change. 34 (FuncDeclNode::streamTo): Ditto. 35 (FuncExprNode::streamTo): Ditto. 36 37 * kjs/kjs-test: Removed. Was part of "make check". 38 * kjs/kjs-test.chk: Ditto. 39 * kjs/test.js: Ditto. 40 41 * tests/mozilla/expected.html: Updated because one more test succeeds. 42 1 43 2005-09-27 Adele Peterson <[email protected]> 2 44 -
trunk/JavaScriptCore/kjs/grammar.y
r10621 r10646 42 42 #define YYERROR_VERBOSE 43 43 #endif 44 #define DBG(l, s, e) { l->setLoc(s.first_line, e.last_line, Parser::sid); } // location45 44 46 45 extern int kjsyylex(); 47 46 int kjsyyerror(const char *); 48 static bool automatic(); 47 static bool allowAutomaticSemicolon(); 48 49 #define AUTO_SEMICOLON do { if (!allowAutomaticSemicolon()) YYABORT; } while (0) 50 #define DBG(l, s, e) (l)->setLoc((s).first_line, (e).last_line, Parser::sid) 49 51 50 52 using namespace KJS; … … 85 87 PropertyValueNode *plist; 86 88 PropertyNode *pnode; 87 CatchNode *cnode;88 FinallyNode *fnode;89 89 } 90 90 91 91 %start Program 92 93 /* expect a shift/reduce conflict from the "dangling else" problem94 when using bison the warning can be supressed */95 // %expect 196 92 97 93 /* literals */ … … 102 98 %token BREAK CASE DEFAULT FOR NEW VAR CONST CONTINUE 103 99 %token FUNCTION RETURN VOID DELETE 104 %token IF THIS DO WHILE ELSEIN INSTANCEOF TYPEOF100 %token IF THIS DO WHILE IN INSTANCEOF TYPEOF 105 101 %token SWITCH WITH RESERVED 106 102 %token THROW TRY CATCH FINALLY 103 104 /* give an if without an else higher precedence than an else to resolve the ambiguity */ 105 %nonassoc IF_WITHOUT_ELSE 106 %nonassoc ELSE 107 107 108 108 /* punctuators */ … … 130 130 131 131 /* non-terminal types */ 132 %type <node> Literal PrimaryExpr Expr MemberExpr NewExpr CallExpr 133 %type <node> ArrayLiteral 134 %type <node> LeftHandSideExpr PostfixExpr UnaryExpr 135 %type <node> MultiplicativeExpr AdditiveExpr 136 %type <node> ShiftExpr RelationalExpr EqualityExpr 137 %type <node> BitwiseANDExpr BitwiseXORExpr BitwiseORExpr 138 %type <node> LogicalANDExpr LogicalORExpr 139 %type <node> ConditionalExpr AssignmentExpr 140 %type <node> ExprOpt 141 142 %type <cnode> Catch 143 %type <fnode> Finally 132 %type <node> Literal ArrayLiteral 133 134 %type <node> PrimaryExpr PrimaryExprNoBrace 135 %type <node> MemberExpr MemberExprNoBF /* BF => brace or function */ 136 %type <node> NewExpr NewExprNoBF 137 %type <node> CallExpr CallExprNoBF 138 %type <node> LeftHandSideExpr LeftHandSideExprNoBF 139 %type <node> PostfixExpr PostfixExprNoBF 140 %type <node> UnaryExpr UnaryExprNoBF UnaryExprCommon 141 %type <node> MultiplicativeExpr MultiplicativeExprNoBF 142 %type <node> AdditiveExpr AdditiveExprNoBF 143 %type <node> ShiftExpr ShiftExprNoBF 144 %type <node> RelationalExpr RelationalExprNoIn RelationalExprNoBF 145 %type <node> EqualityExpr EqualityExprNoIn EqualityExprNoBF 146 %type <node> BitwiseANDExpr BitwiseANDExprNoIn BitwiseANDExprNoBF 147 %type <node> BitwiseXORExpr BitwiseXORExprNoIn BitwiseXORExprNoBF 148 %type <node> BitwiseORExpr BitwiseORExprNoIn BitwiseORExprNoBF 149 %type <node> LogicalANDExpr LogicalANDExprNoIn LogicalANDExprNoBF 150 %type <node> LogicalORExpr LogicalORExprNoIn LogicalORExprNoBF 151 %type <node> ConditionalExpr ConditionalExprNoIn ConditionalExprNoBF 152 %type <node> AssignmentExpr AssignmentExprNoIn AssignmentExprNoBF 153 %type <node> Expr ExprNoIn ExprNoBF 154 155 %type <node> ExprOpt ExprNoInOpt 144 156 145 157 %type <stat> Statement Block … … 152 164 153 165 %type <slist> StatementList 154 %type <init> Initializer 166 %type <init> Initializer InitializerNoIn 155 167 %type <func> FunctionDeclaration 156 168 %type <funcExpr> FunctionExpr … … 159 171 %type <param> FormalParameterList 160 172 %type <op> AssignmentOperator 161 %type <prog> Program162 173 %type <args> Arguments 163 174 %type <alist> ArgumentList 164 %type <vlist> VariableDeclarationList ConstDeclarationList165 %type <decl> VariableDeclaration ConstDeclaration175 %type <vlist> VariableDeclarationList VariableDeclarationListNoIn ConstDeclarationList 176 %type <decl> VariableDeclaration VariableDeclarationNoIn ConstDeclaration 166 177 %type <cblk> CaseBlock 167 178 %type <ccl> CaseClause DefaultClause … … 175 186 176 187 Literal: 177 NULLTOKEN { $$ = new NullNode(); } 178 | TRUETOKEN { $$ = new BooleanNode(true); } 179 | FALSETOKEN { $$ = new BooleanNode(false); } 180 | NUMBER { $$ = new NumberNode($1); } 181 | STRING { $$ = new StringNode($1); } 182 | '/' /* a RegExp ? */ { Lexer *l = Lexer::curr(); 183 if (!l->scanRegExp()) YYABORT; 184 $$ = new RegExpNode(l->pattern,l->flags);} 185 | DIVEQUAL /* a RegExp starting with /= ! */ 186 { Lexer *l = Lexer::curr(); 187 if (!l->scanRegExp()) YYABORT; 188 $$ = new RegExpNode(UString('=')+l->pattern,l->flags);} 188 NULLTOKEN { $$ = new NullNode(); } 189 | TRUETOKEN { $$ = new BooleanNode(true); } 190 | FALSETOKEN { $$ = new BooleanNode(false); } 191 | NUMBER { $$ = new NumberNode($1); } 192 | STRING { $$ = new StringNode($1); } 193 | '/' /* regexp */ { 194 Lexer *l = Lexer::curr(); 195 if (!l->scanRegExp()) YYABORT; 196 $$ = new RegExpNode(l->pattern, l->flags); 197 } 198 | DIVEQUAL /* regexp with /= */ { 199 Lexer *l = Lexer::curr(); 200 if (!l->scanRegExp()) YYABORT; 201 $$ = new RegExpNode(UString('=') + l->pattern, l->flags); 202 } 189 203 ; 190 204 191 205 PrimaryExpr: 192 THIS { $$ = new ThisNode(); } 206 PrimaryExprNoBrace 207 | '{' '}' { $$ = new ObjectLiteralNode(); } 208 | '{' PropertyNameAndValueList '}' { $$ = new ObjectLiteralNode($2); } 209 ; 210 211 PrimaryExprNoBrace: 212 THIS { $$ = new ThisNode(); } 193 213 | Literal 194 214 | ArrayLiteral 195 | IDENT { $$ = new ResolveNode(*$1); } 196 | '(' Expr ')' { if ($2->isResolveNode()) $$ = $2; else $$ = new GroupNode($2); } 197 | '{' '}' { $$ = new ObjectLiteralNode(); } 198 | '{' PropertyNameAndValueList '}' { $$ = new ObjectLiteralNode($2); } 215 | IDENT { $$ = new ResolveNode(*$1); } 216 | '(' Expr ')' { $$ = $2->isResolveNode() ? $2 : new GroupNode($2); } 199 217 ; 200 218 201 219 ArrayLiteral: 202 '[' ElisionOpt ']' { $$ = new ArrayNode($2); }203 | '[' ElementList ']' { $$ = new ArrayNode($2); }204 | '[' ElementList ',' ElisionOpt ']' { $$ = new ArrayNode($4, $2); }220 '[' ElisionOpt ']' { $$ = new ArrayNode($2); } 221 | '[' ElementList ']' { $$ = new ArrayNode($2); } 222 | '[' ElementList ',' ElisionOpt ']' { $$ = new ArrayNode($4, $2); } 205 223 ; 206 224 207 225 ElementList: 208 ElisionOpt AssignmentExpr { $$ = new ElementNode($1, $2); }226 ElisionOpt AssignmentExpr { $$ = new ElementNode($1, $2); } 209 227 | ElementList ',' ElisionOpt AssignmentExpr 210 { $$ = new ElementNode($1, $3, $4); }228 { $$ = new ElementNode($1, $3, $4); } 211 229 ; 212 230 213 231 ElisionOpt: 214 /* nothing */ { $$ = 0; }232 /* nothing */ { $$ = 0; } 215 233 | Elision 216 234 ; 217 235 218 236 Elision: 219 ',' { $$ = 1; }220 | Elision ',' { $$ = $1 + 1; }237 ',' { $$ = 1; } 238 | Elision ',' { $$ = $1 + 1; } 221 239 ; 222 240 … … 224 242 PropertyName ':' AssignmentExpr { $$ = new PropertyValueNode($1, $3); } 225 243 | PropertyNameAndValueList ',' PropertyName ':' AssignmentExpr 226 { $$ = new PropertyValueNode($3, $5, $1); }244 { $$ = new PropertyValueNode($3, $5, $1); } 227 245 ; 228 246 229 247 PropertyName: 230 IDENT { $$ = new PropertyNode(*$1); }231 | STRING { $$ = new PropertyNode(Identifier(*$1)); }232 | NUMBER { $$ = new PropertyNode($1); }248 IDENT { $$ = new PropertyNode(*$1); } 249 | STRING { $$ = new PropertyNode(Identifier(*$1)); } 250 | NUMBER { $$ = new PropertyNode($1); } 233 251 ; 234 252 235 253 MemberExpr: 236 254 PrimaryExpr 237 | FunctionExpr { $$ = $1; } 238 | MemberExpr '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 239 | MemberExpr '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 240 | NEW MemberExpr Arguments { $$ = new NewExprNode($2, $3); } 255 | FunctionExpr { $$ = $1; } 256 | MemberExpr '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 257 | MemberExpr '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 258 | NEW MemberExpr Arguments { $$ = new NewExprNode($2, $3); } 259 ; 260 261 MemberExprNoBF: 262 PrimaryExprNoBrace 263 | MemberExprNoBF '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 264 | MemberExprNoBF '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 265 | NEW MemberExpr Arguments { $$ = new NewExprNode($2, $3); } 241 266 ; 242 267 243 268 NewExpr: 244 269 MemberExpr 245 | NEW NewExpr { $$ = new NewExprNode($2); } 270 | NEW NewExpr { $$ = new NewExprNode($2); } 271 ; 272 273 NewExprNoBF: 274 MemberExprNoBF 275 | NEW NewExpr { $$ = new NewExprNode($2); } 246 276 ; 247 277 248 278 CallExpr: 249 MemberExpr Arguments { $$ = makeFunctionCallNode($1, $2); } 250 | CallExpr Arguments { $$ = makeFunctionCallNode($1, $2); } 251 | CallExpr '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 252 | CallExpr '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 279 MemberExpr Arguments { $$ = makeFunctionCallNode($1, $2); } 280 | CallExpr Arguments { $$ = makeFunctionCallNode($1, $2); } 281 | CallExpr '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 282 | CallExpr '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 283 ; 284 285 CallExprNoBF: 286 MemberExprNoBF Arguments { $$ = makeFunctionCallNode($1, $2); } 287 | CallExprNoBF Arguments { $$ = makeFunctionCallNode($1, $2); } 288 | CallExprNoBF '[' Expr ']' { $$ = new BracketAccessorNode($1, $3); } 289 | CallExprNoBF '.' IDENT { $$ = new DotAccessorNode($1, *$3); } 253 290 ; 254 291 255 292 Arguments: 256 '(' ')' { $$ = new ArgumentsNode(); }257 | '(' ArgumentList ')' { $$ = new ArgumentsNode($2); }293 '(' ')' { $$ = new ArgumentsNode(); } 294 | '(' ArgumentList ')' { $$ = new ArgumentsNode($2); } 258 295 ; 259 296 260 297 ArgumentList: 261 AssignmentExpr { $$ = new ArgumentListNode($1); }262 | ArgumentList ',' AssignmentExpr { $$ = new ArgumentListNode($1, $3); }298 AssignmentExpr { $$ = new ArgumentListNode($1); } 299 | ArgumentList ',' AssignmentExpr { $$ = new ArgumentListNode($1, $3); } 263 300 ; 264 301 … … 268 305 ; 269 306 270 PostfixExpr: /* TODO: no line terminator here */ 307 LeftHandSideExprNoBF: 308 NewExprNoBF 309 | CallExprNoBF 310 ; 311 312 PostfixExpr: 271 313 LeftHandSideExpr 272 | LeftHandSideExpr PLUSPLUS { if (!makePostfixNode($$, $1, OpPlusPlus)) YYABORT; } 273 | LeftHandSideExpr MINUSMINUS { if (!makePostfixNode($$, $1, OpMinusMinus)) YYABORT; } 274 ; 314 | LeftHandSideExpr PLUSPLUS { if (!makePostfixNode($$, $1, OpPlusPlus)) YYABORT; } 315 | LeftHandSideExpr MINUSMINUS { if (!makePostfixNode($$, $1, OpMinusMinus)) YYABORT; } 316 ; 317 318 PostfixExprNoBF: 319 LeftHandSideExprNoBF 320 | LeftHandSideExprNoBF PLUSPLUS { if (!makePostfixNode($$, $1, OpPlusPlus)) YYABORT; } 321 | LeftHandSideExprNoBF MINUSMINUS { if (!makePostfixNode($$, $1, OpMinusMinus)) YYABORT; } 322 ; 323 324 UnaryExprCommon: 325 DELETE UnaryExpr { $$ = makeDeleteNode($2); } 326 | VOID UnaryExpr { $$ = new VoidNode($2); } 327 | TYPEOF UnaryExpr { $$ = makeTypeOfNode($2); } 328 | PLUSPLUS UnaryExpr { if (!makePrefixNode($$, $2, OpPlusPlus)) YYABORT; } 329 | AUTOPLUSPLUS UnaryExpr { if (!makePrefixNode($$, $2, OpPlusPlus)) YYABORT; } 330 | MINUSMINUS UnaryExpr { if (!makePrefixNode($$, $2, OpMinusMinus)) YYABORT; } 331 | AUTOMINUSMINUS UnaryExpr { if (!makePrefixNode($$, $2, OpMinusMinus)) YYABORT; } 332 | '+' UnaryExpr { $$ = new UnaryPlusNode($2); } 333 | '-' UnaryExpr { $$ = new NegateNode($2); } 334 | '~' UnaryExpr { $$ = new BitwiseNotNode($2); } 335 | '!' UnaryExpr { $$ = new LogicalNotNode($2); } 275 336 276 337 UnaryExpr: 277 338 PostfixExpr 278 | DELETE UnaryExpr { $$ = makeDeleteNode($2); } 279 | VOID UnaryExpr { $$ = new VoidNode($2); } 280 | TYPEOF UnaryExpr { $$ = makeTypeOfNode($2); } 281 | PLUSPLUS UnaryExpr { if (!makePrefixNode($$, $2, OpPlusPlus)) YYABORT; } 282 | AUTOPLUSPLUS UnaryExpr { if (!makePrefixNode($$, $2, OpPlusPlus)) YYABORT; } 283 | MINUSMINUS UnaryExpr { if (!makePrefixNode($$, $2, OpMinusMinus)) YYABORT; } 284 | AUTOMINUSMINUS UnaryExpr { if (!makePrefixNode($$, $2, OpMinusMinus)) YYABORT; } 285 | '+' UnaryExpr { $$ = new UnaryPlusNode($2); } 286 | '-' UnaryExpr { $$ = new NegateNode($2); } 287 | '~' UnaryExpr { $$ = new BitwiseNotNode($2); } 288 | '!' UnaryExpr { $$ = new LogicalNotNode($2); } 339 | UnaryExprCommon 340 ; 341 342 UnaryExprNoBF: 343 PostfixExprNoBF 344 | UnaryExprCommon 289 345 ; 290 346 291 347 MultiplicativeExpr: 292 348 UnaryExpr 293 | MultiplicativeExpr '*' UnaryExpr { $$ = new MultNode($1, $3, '*'); } 294 | MultiplicativeExpr '/' UnaryExpr { $$ = new MultNode($1, $3, '/'); } 295 | MultiplicativeExpr '%' UnaryExpr { $$ = new MultNode($1,$3,'%'); } 349 | MultiplicativeExpr '*' UnaryExpr { $$ = new MultNode($1, $3, '*'); } 350 | MultiplicativeExpr '/' UnaryExpr { $$ = new MultNode($1, $3, '/'); } 351 | MultiplicativeExpr '%' UnaryExpr { $$ = new MultNode($1, $3,'%'); } 352 ; 353 354 MultiplicativeExprNoBF: 355 UnaryExprNoBF 356 | MultiplicativeExprNoBF '*' UnaryExpr 357 { $$ = new MultNode($1, $3, '*'); } 358 | MultiplicativeExprNoBF '/' UnaryExpr 359 { $$ = new MultNode($1, $3, '/'); } 360 | MultiplicativeExprNoBF '%' UnaryExpr 361 { $$ = new MultNode($1, $3,'%'); } 296 362 ; 297 363 … … 302 368 ; 303 369 370 AdditiveExprNoBF: 371 MultiplicativeExprNoBF 372 | AdditiveExprNoBF '+' MultiplicativeExpr 373 { $$ = new AddNode($1, $3, '+'); } 374 | AdditiveExprNoBF '-' MultiplicativeExpr 375 { $$ = new AddNode($1, $3, '-'); } 376 ; 377 304 378 ShiftExpr: 305 379 AdditiveExpr 306 | ShiftExpr LSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpLShift, $3); } 307 | ShiftExpr RSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpRShift, $3); } 308 | ShiftExpr URSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpURShift, $3); } 380 | ShiftExpr LSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpLShift, $3); } 381 | ShiftExpr RSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpRShift, $3); } 382 | ShiftExpr URSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpURShift, $3); } 383 ; 384 385 ShiftExprNoBF: 386 AdditiveExprNoBF 387 | ShiftExprNoBF LSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpLShift, $3); } 388 | ShiftExprNoBF RSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpRShift, $3); } 389 | ShiftExprNoBF URSHIFT AdditiveExpr { $$ = new ShiftNode($1, OpURShift, $3); } 309 390 ; 310 391 311 392 RelationalExpr: 312 393 ShiftExpr 313 | RelationalExpr '<' ShiftExpr 314 { $$ = new RelationalNode($1, OpLess, $3); } 315 | RelationalExpr '>' ShiftExpr 316 { $$ = new RelationalNode($1, OpGreater, $3); } 317 | RelationalExpr LE ShiftExpr 318 { $$ = new RelationalNode($1, OpLessEq, $3); } 319 | RelationalExpr GE ShiftExpr 320 { $$ = new RelationalNode($1, OpGreaterEq, $3); } 321 | RelationalExpr INSTANCEOF ShiftExpr 322 { $$ = new RelationalNode($1, OpInstanceOf, $3); } 323 | RelationalExpr IN ShiftExpr 324 { $$ = new RelationalNode($1, OpIn, $3); } 394 | RelationalExpr '<' ShiftExpr { $$ = new RelationalNode($1, OpLess, $3); } 395 | RelationalExpr '>' ShiftExpr { $$ = new RelationalNode($1, OpGreater, $3); } 396 | RelationalExpr LE ShiftExpr { $$ = new RelationalNode($1, OpLessEq, $3); } 397 | RelationalExpr GE ShiftExpr { $$ = new RelationalNode($1, OpGreaterEq, $3); } 398 | RelationalExpr INSTANCEOF ShiftExpr { $$ = new RelationalNode($1, OpInstanceOf, $3); } 399 | RelationalExpr IN ShiftExpr { $$ = new RelationalNode($1, OpIn, $3); } 400 ; 401 402 RelationalExprNoIn: 403 ShiftExpr 404 | RelationalExprNoIn '<' ShiftExpr { $$ = new RelationalNode($1, OpLess, $3); } 405 | RelationalExprNoIn '>' ShiftExpr { $$ = new RelationalNode($1, OpGreater, $3); } 406 | RelationalExprNoIn LE ShiftExpr { $$ = new RelationalNode($1, OpLessEq, $3); } 407 | RelationalExprNoIn GE ShiftExpr { $$ = new RelationalNode($1, OpGreaterEq, $3); } 408 | RelationalExprNoIn INSTANCEOF ShiftExpr 409 { $$ = new RelationalNode($1, OpInstanceOf, $3); } 410 ; 411 412 RelationalExprNoBF: 413 ShiftExprNoBF 414 | RelationalExprNoBF '<' ShiftExpr { $$ = new RelationalNode($1, OpLess, $3); } 415 | RelationalExprNoBF '>' ShiftExpr { $$ = new RelationalNode($1, OpGreater, $3); } 416 | RelationalExprNoBF LE ShiftExpr { $$ = new RelationalNode($1, OpLessEq, $3); } 417 | RelationalExprNoBF GE ShiftExpr { $$ = new RelationalNode($1, OpGreaterEq, $3); } 418 | RelationalExprNoBF INSTANCEOF ShiftExpr 419 { $$ = new RelationalNode($1, OpInstanceOf, $3); } 420 | RelationalExprNoBF IN ShiftExpr { $$ = new RelationalNode($1, OpIn, $3); } 325 421 ; 326 422 327 423 EqualityExpr: 328 424 RelationalExpr 329 | EqualityExpr EQEQ RelationalExpr { $$ = new EqualNode($1, OpEqEq, $3); } 330 | EqualityExpr NE RelationalExpr { $$ = new EqualNode($1, OpNotEq, $3); } 331 | EqualityExpr STREQ RelationalExpr { $$ = new EqualNode($1, OpStrEq, $3); } 332 | EqualityExpr STRNEQ RelationalExpr { $$ = new EqualNode($1, OpStrNEq, $3);} 425 | EqualityExpr EQEQ RelationalExpr { $$ = new EqualNode($1, OpEqEq, $3); } 426 | EqualityExpr NE RelationalExpr { $$ = new EqualNode($1, OpNotEq, $3); } 427 | EqualityExpr STREQ RelationalExpr { $$ = new EqualNode($1, OpStrEq, $3); } 428 | EqualityExpr STRNEQ RelationalExpr { $$ = new EqualNode($1, OpStrNEq, $3);} 429 ; 430 431 EqualityExprNoIn: 432 RelationalExprNoIn 433 | EqualityExprNoIn EQEQ RelationalExprNoIn 434 { $$ = new EqualNode($1, OpEqEq, $3); } 435 | EqualityExprNoIn NE RelationalExprNoIn 436 { $$ = new EqualNode($1, OpNotEq, $3); } 437 | EqualityExprNoIn STREQ RelationalExprNoIn 438 { $$ = new EqualNode($1, OpStrEq, $3); } 439 | EqualityExprNoIn STRNEQ RelationalExprNoIn 440 { $$ = new EqualNode($1, OpStrNEq, $3);} 441 ; 442 443 EqualityExprNoBF: 444 RelationalExprNoBF 445 | EqualityExprNoBF EQEQ RelationalExpr 446 { $$ = new EqualNode($1, OpEqEq, $3); } 447 | EqualityExprNoBF NE RelationalExpr { $$ = new EqualNode($1, OpNotEq, $3); } 448 | EqualityExprNoBF STREQ RelationalExpr 449 { $$ = new EqualNode($1, OpStrEq, $3); } 450 | EqualityExprNoBF STRNEQ RelationalExpr 451 { $$ = new EqualNode($1, OpStrNEq, $3);} 333 452 ; 334 453 335 454 BitwiseANDExpr: 336 455 EqualityExpr 337 | BitwiseANDExpr '&' EqualityExpr { $$ = new BitOperNode($1, OpBitAnd, $3); } 456 | BitwiseANDExpr '&' EqualityExpr { $$ = new BitOperNode($1, OpBitAnd, $3); } 457 ; 458 459 BitwiseANDExprNoIn: 460 EqualityExprNoIn 461 | BitwiseANDExprNoIn '&' EqualityExprNoIn 462 { $$ = new BitOperNode($1, OpBitAnd, $3); } 463 ; 464 465 BitwiseANDExprNoBF: 466 EqualityExprNoBF 467 | BitwiseANDExprNoBF '&' EqualityExpr { $$ = new BitOperNode($1, OpBitAnd, $3); } 338 468 ; 339 469 340 470 BitwiseXORExpr: 341 471 BitwiseANDExpr 342 | BitwiseXORExpr '^' BitwiseANDExpr { $$ = new BitOperNode($1, OpBitXOr, $3); } 472 | BitwiseXORExpr '^' BitwiseANDExpr { $$ = new BitOperNode($1, OpBitXOr, $3); } 473 ; 474 475 BitwiseXORExprNoIn: 476 BitwiseANDExprNoIn 477 | BitwiseXORExprNoIn '^' BitwiseANDExprNoIn 478 { $$ = new BitOperNode($1, OpBitXOr, $3); } 479 ; 480 481 BitwiseXORExprNoBF: 482 BitwiseANDExprNoBF 483 | BitwiseXORExprNoBF '^' BitwiseANDExpr 484 { $$ = new BitOperNode($1, OpBitXOr, $3); } 343 485 ; 344 486 345 487 BitwiseORExpr: 346 488 BitwiseXORExpr 347 | BitwiseORExpr '|' BitwiseXORExpr { $$ = new BitOperNode($1, OpBitOr, $3); } 489 | BitwiseORExpr '|' BitwiseXORExpr { $$ = new BitOperNode($1, OpBitOr, $3); } 490 ; 491 492 BitwiseORExprNoIn: 493 BitwiseXORExprNoIn 494 | BitwiseORExprNoIn '|' BitwiseXORExprNoIn 495 { $$ = new BitOperNode($1, OpBitOr, $3); } 496 ; 497 498 BitwiseORExprNoBF: 499 BitwiseXORExprNoBF 500 | BitwiseORExprNoBF '|' BitwiseXORExpr 501 { $$ = new BitOperNode($1, OpBitOr, $3); } 348 502 ; 349 503 350 504 LogicalANDExpr: 351 505 BitwiseORExpr 352 | LogicalANDExpr AND BitwiseORExpr 353 { $$ = new BinaryLogicalNode($1, OpAnd, $3); } 506 | LogicalANDExpr AND BitwiseORExpr { $$ = new BinaryLogicalNode($1, OpAnd, $3); } 507 ; 508 509 LogicalANDExprNoIn: 510 BitwiseORExprNoIn 511 | LogicalANDExprNoIn AND BitwiseORExprNoIn 512 { $$ = new BinaryLogicalNode($1, OpAnd, $3); } 513 ; 514 515 LogicalANDExprNoBF: 516 BitwiseORExprNoBF 517 | LogicalANDExprNoBF AND BitwiseORExpr 518 { $$ = new BinaryLogicalNode($1, OpAnd, $3); } 354 519 ; 355 520 356 521 LogicalORExpr: 357 522 LogicalANDExpr 358 | LogicalORExpr OR LogicalANDExpr 359 { $$ = new BinaryLogicalNode($1, OpOr, $3); } 523 | LogicalORExpr OR LogicalANDExpr { $$ = new BinaryLogicalNode($1, OpOr, $3); } 524 ; 525 526 LogicalORExprNoIn: 527 LogicalANDExprNoIn 528 | LogicalORExprNoIn OR LogicalANDExprNoIn 529 { $$ = new BinaryLogicalNode($1, OpOr, $3); } 530 ; 531 532 LogicalORExprNoBF: 533 LogicalANDExprNoBF 534 | LogicalORExprNoBF OR LogicalANDExpr { $$ = new BinaryLogicalNode($1, OpOr, $3); } 360 535 ; 361 536 … … 363 538 LogicalORExpr 364 539 | LogicalORExpr '?' AssignmentExpr ':' AssignmentExpr 365 { $$ = new ConditionalNode($1, $3, $5); } 540 { $$ = new ConditionalNode($1, $3, $5); } 541 ; 542 543 ConditionalExprNoIn: 544 LogicalORExprNoIn 545 | LogicalORExprNoIn '?' AssignmentExprNoIn ':' AssignmentExprNoIn 546 { $$ = new ConditionalNode($1, $3, $5); } 547 ; 548 549 ConditionalExprNoBF: 550 LogicalORExprNoBF 551 | LogicalORExprNoBF '?' AssignmentExpr ':' AssignmentExpr 552 { $$ = new ConditionalNode($1, $3, $5); } 366 553 ; 367 554 … … 369 556 ConditionalExpr 370 557 | LeftHandSideExpr AssignmentOperator AssignmentExpr 371 { if (!makeAssignNode($$, $1, $2, $3)) YYABORT; } 558 { if (!makeAssignNode($$, $1, $2, $3)) YYABORT; } 559 ; 560 561 AssignmentExprNoIn: 562 ConditionalExprNoIn 563 | LeftHandSideExpr AssignmentOperator AssignmentExprNoIn 564 { if (!makeAssignNode($$, $1, $2, $3)) YYABORT; } 565 ; 566 567 AssignmentExprNoBF: 568 ConditionalExprNoBF 569 | LeftHandSideExprNoBF AssignmentOperator AssignmentExpr 570 { if (!makeAssignNode($$, $1, $2, $3)) YYABORT; } 372 571 ; 373 572 374 573 AssignmentOperator: 375 '=' { $$ = OpEqual; }376 | PLUSEQUAL { $$ = OpPlusEq; }377 | MINUSEQUAL { $$ = OpMinusEq; }378 | MULTEQUAL { $$ = OpMultEq; }379 | DIVEQUAL { $$ = OpDivEq; }380 | LSHIFTEQUAL { $$ = OpLShift; }381 | RSHIFTEQUAL { $$ = OpRShift; }382 | URSHIFTEQUAL { $$ = OpURShift; }383 | ANDEQUAL { $$ = OpAndEq; }384 | XOREQUAL { $$ = OpXOrEq; }385 | OREQUAL { $$ = OpOrEq; }386 | MODEQUAL { $$ = OpModEq; }574 '=' { $$ = OpEqual; } 575 | PLUSEQUAL { $$ = OpPlusEq; } 576 | MINUSEQUAL { $$ = OpMinusEq; } 577 | MULTEQUAL { $$ = OpMultEq; } 578 | DIVEQUAL { $$ = OpDivEq; } 579 | LSHIFTEQUAL { $$ = OpLShift; } 580 | RSHIFTEQUAL { $$ = OpRShift; } 581 | URSHIFTEQUAL { $$ = OpURShift; } 582 | ANDEQUAL { $$ = OpAndEq; } 583 | XOREQUAL { $$ = OpXOrEq; } 584 | OREQUAL { $$ = OpOrEq; } 585 | MODEQUAL { $$ = OpModEq; } 387 586 ; 388 587 389 588 Expr: 390 589 AssignmentExpr 391 | Expr ',' AssignmentExpr { $$ = new CommaNode($1, $3); } 590 | Expr ',' AssignmentExpr { $$ = new CommaNode($1, $3); } 591 ; 592 593 ExprNoIn: 594 AssignmentExprNoIn 595 | ExprNoIn ',' AssignmentExprNoIn { $$ = new CommaNode($1, $3); } 596 ; 597 598 ExprNoBF: 599 AssignmentExprNoBF 600 | ExprNoBF ',' AssignmentExpr { $$ = new CommaNode($1, $3); } 392 601 ; 393 602 … … 411 620 412 621 Block: 413 '{' '}' { $$ = new BlockNode(0); DBG($$, @2, @2); }414 | '{' SourceElements '}' { $$ = new BlockNode($2); DBG($$, @3, @3); }622 '{' '}' { $$ = new BlockNode(0); DBG($$, @2, @2); } 623 | '{' SourceElements '}' { $$ = new BlockNode($2); DBG($$, @3, @3); } 415 624 ; 416 625 417 626 StatementList: 418 Statement { $$ = new StatListNode($1); }419 | StatementList Statement { $$ = new StatListNode($1, $2); }627 Statement { $$ = new StatListNode($1); } 628 | StatementList Statement { $$ = new StatListNode($1, $2); } 420 629 ; 421 630 422 631 VariableStatement: 423 VAR VariableDeclarationList ';' { $$ = new VarStatementNode($2); 424 DBG($$, @1, @3); } 425 | VAR VariableDeclarationList error { if (automatic()) { 426 $$ = new VarStatementNode($2); 427 DBG($$, @1, @2); 428 } else { 429 YYABORT; 430 } 431 } 632 VAR VariableDeclarationList ';' { $$ = new VarStatementNode($2); DBG($$, @1, @3); } 633 | VAR VariableDeclarationList error { $$ = new VarStatementNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; } 432 634 ; 433 635 434 636 VariableDeclarationList: 435 VariableDeclaration { $$ = new VarDeclListNode($1); }637 VariableDeclaration { $$ = new VarDeclListNode($1); } 436 638 | VariableDeclarationList ',' VariableDeclaration 437 { $$ = new VarDeclListNode($1, $3); } 639 { $$ = new VarDeclListNode($1, $3); } 640 ; 641 642 VariableDeclarationListNoIn: 643 VariableDeclarationNoIn { $$ = new VarDeclListNode($1); } 644 | VariableDeclarationListNoIn ',' VariableDeclarationNoIn 645 { $$ = new VarDeclListNode($1, $3); } 438 646 ; 439 647 440 648 VariableDeclaration: 441 IDENT { $$ = new VarDeclNode(*$1, 0, VarDeclNode::Variable); } 442 | IDENT Initializer { $$ = new VarDeclNode(*$1, $2, VarDeclNode::Variable); } 649 IDENT { $$ = new VarDeclNode(*$1, 0, VarDeclNode::Variable); } 650 | IDENT Initializer { $$ = new VarDeclNode(*$1, $2, VarDeclNode::Variable); } 651 ; 652 653 VariableDeclarationNoIn: 654 IDENT { $$ = new VarDeclNode(*$1, 0, VarDeclNode::Variable); } 655 | IDENT InitializerNoIn { $$ = new VarDeclNode(*$1, $2, VarDeclNode::Variable); } 443 656 ; 444 657 445 658 ConstStatement: 446 CONST ConstDeclarationList ';' { $$ = new VarStatementNode($2); 447 DBG($$, @1, @3); } 448 | CONST ConstDeclarationList error { if (automatic()) { 449 $$ = new VarStatementNode($2); 450 DBG($$, @1, @2); 451 } else { 452 YYABORT; 453 } 454 } 659 CONST ConstDeclarationList ';' { $$ = new VarStatementNode($2); DBG($$, @1, @3); } 660 | CONST ConstDeclarationList error { $$ = new VarStatementNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; } 455 661 ; 456 662 457 663 ConstDeclarationList: 458 ConstDeclaration { $$ = new VarDeclListNode($1); }459 | ConstDeclarationList ',' VariableDeclaration460 { $$ = new VarDeclListNode($1, $3); }664 ConstDeclaration { $$ = new VarDeclListNode($1); } 665 | ConstDeclarationList ',' ConstDeclaration 666 { $$ = new VarDeclListNode($1, $3); } 461 667 ; 462 668 463 669 ConstDeclaration: 464 IDENT { $$ = new VarDeclNode(*$1, 0, VarDeclNode::Constant); }465 | IDENT Initializer { $$ = new VarDeclNode(*$1, $2, VarDeclNode::Constant); }670 IDENT { $$ = new VarDeclNode(*$1, 0, VarDeclNode::Constant); } 671 | IDENT Initializer { $$ = new VarDeclNode(*$1, $2, VarDeclNode::Constant); } 466 672 ; 467 673 468 674 Initializer: 469 '=' AssignmentExpr { $$ = new AssignExprNode($2); } 675 '=' AssignmentExpr { $$ = new AssignExprNode($2); } 676 ; 677 678 InitializerNoIn: 679 '=' AssignmentExprNoIn { $$ = new AssignExprNode($2); } 470 680 ; 471 681 472 682 EmptyStatement: 473 ';' { $$ = new EmptyStatementNode(); }683 ';' { $$ = new EmptyStatementNode(); } 474 684 ; 475 685 476 686 ExprStatement: 477 Expr ';' { $$ = new ExprStatementNode($1); 478 DBG($$, @1, @2); } 479 | Expr error { if (automatic()) { 480 $$ = new ExprStatementNode($1); 481 DBG($$, @1, @1); 482 } else 483 YYABORT; } 484 ; 485 486 IfStatement: /* shift/reduce conflict due to dangling else */ 487 IF '(' Expr ')' Statement { $$ = new IfNode($3,$5,0);DBG($$,@1,@4); } 687 ExprNoBF ';' { $$ = new ExprStatementNode($1); DBG($$, @1, @2); } 688 | ExprNoBF error { $$ = new ExprStatementNode($1); DBG($$, @1, @1); AUTO_SEMICOLON; } 689 ; 690 691 IfStatement: 692 IF '(' Expr ')' Statement %prec IF_WITHOUT_ELSE 693 { $$ = new IfNode($3, $5, 0); DBG($$, @1, @4); } 488 694 | IF '(' Expr ')' Statement ELSE Statement 489 { $$ = new IfNode($3,$5,$7);DBG($$,@1,@4); }695 { $$ = new IfNode($3, $5, $7); DBG($$, @1, @4); } 490 696 ; 491 697 492 698 IterationStatement: 493 DO Statement WHILE '(' Expr ')' { $$=new DoWhileNode($2,$5);DBG($$,@1,@3);} 494 | WHILE '(' Expr ')' Statement { $$ = new WhileNode($3,$5);DBG($$,@1,@4); } 495 | FOR '(' ExprOpt ';' ExprOpt ';' ExprOpt ')' 496 Statement { $$ = new ForNode($3,$5,$7,$9); 497 DBG($$,@1,@8); } 498 | FOR '(' VAR VariableDeclarationList ';' ExprOpt ';' ExprOpt ')' 499 Statement { $$ = new ForNode($4,$6,$8,$10); 500 DBG($$,@1,@9); } 501 | FOR '(' LeftHandSideExpr IN Expr ')' 502 Statement { 503 Node *n = $3; 504 bool paren = n->isGroupNode(); 505 if (paren) 506 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 507 508 if (!n->isLocation()) 509 YYABORT; 510 511 $$ = new ForInNode(n, $5, $7); 512 DBG($$,@1,@6); 513 } 514 | FOR '(' VAR IDENT IN Expr ')' 515 Statement { $$ = new ForInNode(*$4,0,$6,$8); 516 DBG($$,@1,@7); } 517 | FOR '(' VAR IDENT Initializer IN Expr ')' 518 Statement { $$ = new ForInNode(*$4,$5,$7,$9); 519 DBG($$,@1,@8); } 699 DO Statement WHILE '(' Expr ')' { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3);} 700 | WHILE '(' Expr ')' Statement { $$ = new WhileNode($3, $5); DBG($$, @1, @4); } 701 | FOR '(' ExprNoInOpt ';' ExprOpt ';' ExprOpt ')' Statement 702 { $$ = new ForNode($3, $5, $7, $9); DBG($$, @1, @8); } 703 | FOR '(' VAR VariableDeclarationListNoIn ';' ExprOpt ';' ExprOpt ')' Statement 704 { $$ = new ForNode($4, $6, $8, $10); DBG($$, @1, @9); } 705 | FOR '(' LeftHandSideExpr IN Expr ')' Statement 706 { 707 Node *n = $3->nodeInsideAllParens(); 708 if (!n->isLocation()) 709 YYABORT; 710 $$ = new ForInNode(n, $5, $7); 711 DBG($$, @1, @6); 712 } 713 | FOR '(' VAR IDENT IN Expr ')' Statement 714 { $$ = new ForInNode(*$4, 0, $6, $8); DBG($$, @1, @7); } 715 | FOR '(' VAR IDENT InitializerNoIn IN Expr ')' Statement 716 { $$ = new ForInNode(*$4, $5, $7, $9); DBG($$, @1, @8); } 520 717 ; 521 718 522 719 ExprOpt: 523 /* nothing */ { $$ = 0; }720 /* nothing */ { $$ = 0; } 524 721 | Expr 525 722 ; 526 723 724 ExprNoInOpt: 725 /* nothing */ { $$ = 0; } 726 | ExprNoIn 727 ; 728 527 729 ContinueStatement: 528 CONTINUE ';' { $$ = new ContinueNode(); DBG($$,@1,@2); } 529 | CONTINUE error { if (automatic()) { 530 $$ = new ContinueNode(); DBG($$,@1,@1); 531 } else 532 YYABORT; } 533 | CONTINUE IDENT ';' { $$ = new ContinueNode(*$2); DBG($$,@1,@3); } 534 | CONTINUE IDENT error { if (automatic()) { 535 $$ = new ContinueNode(*$2);DBG($$,@1,@2); 536 } else 537 YYABORT; } 730 CONTINUE ';' { $$ = new ContinueNode(); DBG($$, @1, @2); } 731 | CONTINUE error { $$ = new ContinueNode(); DBG($$, @1, @1); AUTO_SEMICOLON; } 732 | CONTINUE IDENT ';' { $$ = new ContinueNode(*$2); DBG($$, @1, @3); } 733 | CONTINUE IDENT error { $$ = new ContinueNode(*$2); DBG($$, @1, @2); AUTO_SEMICOLON; } 538 734 ; 539 735 540 736 BreakStatement: 541 BREAK ';' { $$ = new BreakNode();DBG($$,@1,@2); } 542 | BREAK error { if (automatic()) { 543 $$ = new BreakNode(); DBG($$,@1,@1); 544 } else 545 YYABORT; } 546 | BREAK IDENT ';' { $$ = new BreakNode(*$2); DBG($$,@1,@3); } 547 | BREAK IDENT error { if (automatic()) { 548 $$ = new BreakNode(*$2); DBG($$,@1,@2); 549 } else 550 YYABORT; 551 } 737 BREAK ';' { $$ = new BreakNode(); DBG($$, @1, @2); } 738 | BREAK error { $$ = new BreakNode(); DBG($$, @1, @1); AUTO_SEMICOLON; } 739 | BREAK IDENT ';' { $$ = new BreakNode(*$2); DBG($$, @1, @3); } 740 | BREAK IDENT error { $$ = new BreakNode(*$2); DBG($$, @1, @2); AUTO_SEMICOLON; } 552 741 ; 553 742 554 743 ReturnStatement: 555 RETURN ';' { $$ = new ReturnNode(0); DBG($$,@1,@2); } 556 | RETURN error { if (automatic()) { 557 $$ = new ReturnNode(0); DBG($$,@1,@1); 558 } else 559 YYABORT; } 560 | RETURN Expr ';' { $$ = new ReturnNode($2); DBG($$,@1,@3); } 561 | RETURN Expr error { if (automatic()) { 562 $$ = new ReturnNode($2); DBG($$,@1,@2); 563 } else 564 YYABORT; } 744 RETURN ';' { $$ = new ReturnNode(0); DBG($$, @1, @2); } 745 | RETURN error { $$ = new ReturnNode(0); DBG($$, @1, @1); AUTO_SEMICOLON; } 746 | RETURN Expr ';' { $$ = new ReturnNode($2); DBG($$, @1, @3); } 747 | RETURN Expr error { $$ = new ReturnNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; } 565 748 ; 566 749 567 750 WithStatement: 568 WITH '(' Expr ')' Statement { $$ = new WithNode($3,$5); 569 DBG($$, @1, @4); } 751 WITH '(' Expr ')' Statement { $$ = new WithNode($3, $5); DBG($$, @1, @4); } 570 752 ; 571 753 572 754 SwitchStatement: 573 SWITCH '(' Expr ')' CaseBlock { $$ = new SwitchNode($3, $5); 574 DBG($$, @1, @4); } 755 SWITCH '(' Expr ')' CaseBlock { $$ = new SwitchNode($3, $5); DBG($$, @1, @4); } 575 756 ; 576 757 577 758 CaseBlock: 578 '{' CaseClausesOpt '}' { $$ = new CaseBlockNode($2, 0, 0); }759 '{' CaseClausesOpt '}' { $$ = new CaseBlockNode($2, 0, 0); } 579 760 | '{' CaseClausesOpt DefaultClause CaseClausesOpt '}' 580 { $$ = new CaseBlockNode($2, $3, $4); }761 { $$ = new CaseBlockNode($2, $3, $4); } 581 762 ; 582 763 583 764 CaseClausesOpt: 584 /* nothing */ { $$ = 0; }765 /* nothing */ { $$ = 0; } 585 766 | CaseClauses 586 767 ; 587 768 588 769 CaseClauses: 589 CaseClause { $$ = new ClauseListNode($1); }590 | CaseClauses CaseClause { $$ = new ClauseListNode($1, $2); }770 CaseClause { $$ = new ClauseListNode($1); } 771 | CaseClauses CaseClause { $$ = new ClauseListNode($1, $2); } 591 772 ; 592 773 593 774 CaseClause: 594 CASE Expr ':' { $$ = new CaseClauseNode($2); }595 | CASE Expr ':' StatementList { $$ = new CaseClauseNode($2, $4); }775 CASE Expr ':' { $$ = new CaseClauseNode($2); } 776 | CASE Expr ':' StatementList { $$ = new CaseClauseNode($2, $4); } 596 777 ; 597 778 598 779 DefaultClause: 599 DEFAULT ':' { $$ = new CaseClauseNode(0); }600 | DEFAULT ':' StatementList { $$ = new CaseClauseNode(0, $3); }780 DEFAULT ':' { $$ = new CaseClauseNode(0); } 781 | DEFAULT ':' StatementList { $$ = new CaseClauseNode(0, $3); } 601 782 ; 602 783 603 784 LabelledStatement: 604 IDENT ':' Statement { $3->pushLabel(*$1); 605 $$ = new LabelNode(*$1, $3); } 785 IDENT ':' Statement { $3->pushLabel(*$1); $$ = new LabelNode(*$1, $3); } 606 786 ; 607 787 608 788 ThrowStatement: 609 THROW Expr ';' { $$ = new ThrowNode($2); DBG($$,@1,@3); }610 | THROW Expr error { if (automatic()) { $$ = new ThrowNode($2); DBG($$,@1,@2); } else YYABORT; }789 THROW Expr ';' { $$ = new ThrowNode($2); DBG($$, @1, @3); } 790 | THROW Expr error { $$ = new ThrowNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; } 611 791 ; 612 792 613 793 TryStatement: 614 TRY Block Catch { $$ = new TryNode($2, $3); DBG($$,@1,@2); } 615 | TRY Block Finally { $$ = new TryNode($2, $3); DBG($$,@1,@2); } 616 | TRY Block Catch Finally { $$ = new TryNode($2, $3, $4); DBG($$,@1,@2); } 617 ; 618 619 Catch: 620 CATCH '(' IDENT ')' Block { $$ = new CatchNode(*$3, $5); } 621 ; 622 623 Finally: 624 FINALLY Block { $$ = new FinallyNode($2); } 794 TRY Block FINALLY Block { $$ = new TryNode($2, Identifier::null(), 0, $4); DBG($$, @1, @2); } 795 | TRY Block CATCH '(' IDENT ')' Block { $$ = new TryNode($2, *$5, $7, 0); DBG($$, @1, @2); } 796 | TRY Block CATCH '(' IDENT ')' Block FINALLY Block 797 { $$ = new TryNode($2, *$5, $7, $9); DBG($$, @1, @2); } 625 798 ; 626 799 627 800 FunctionDeclaration: 628 FUNCTION '(' ')' FunctionBody { YYABORT; } 801 FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncDeclNode(*$2, $5); } 802 | FUNCTION IDENT '(' FormalParameterList ')' FunctionBody 803 { $$ = new FuncDeclNode(*$2, $4, $6); } 804 ; 805 806 FunctionExpr: 807 FUNCTION '(' ')' FunctionBody { $$ = new FuncExprNode(Identifier::null(), $4); } 629 808 | FUNCTION '(' FormalParameterList ')' FunctionBody 630 { YYABORT; } 631 | FUNCTION IDENT '(' ')' FunctionBody 632 { $$ = new FuncDeclNode(*$2, $5); } 809 { $$ = new FuncExprNode(Identifier::null(), $3, $5); } 810 | FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncExprNode(*$2, $5); } 633 811 | FUNCTION IDENT '(' FormalParameterList ')' FunctionBody 634 { $$ = new FuncDeclNode(*$2, $4, $6); } 635 ; 636 637 FunctionExpr: 638 FUNCTION '(' ')' FunctionBody { $$ = new FuncExprNode(Identifier::null(), $4); } 639 | FUNCTION '(' FormalParameterList ')' FunctionBody 640 { $$ = new FuncExprNode(Identifier::null(), $3, $5); } 641 | FUNCTION IDENT '(' ')' FunctionBody 642 { $$ = new FuncExprNode(*$2, $5); } 643 | FUNCTION IDENT '(' FormalParameterList ')' FunctionBody 644 { $$ = new FuncExprNode(*$2, $4, $6); } 812 { $$ = new FuncExprNode(*$2, $4, $6); } 645 813 ; 646 814 647 815 FormalParameterList: 648 IDENT { $$ = new ParameterNode(*$1); }649 | FormalParameterList ',' IDENT { $$ = new ParameterNode($1, *$3); }816 IDENT { $$ = new ParameterNode(*$1); } 817 | FormalParameterList ',' IDENT { $$ = new ParameterNode($1, *$3); } 650 818 ; 651 819 652 820 FunctionBody: 653 '{' '}' /* TODO: spec ??? */ { $$ = new FunctionBodyNode(0); 654 DBG($$, @1, @2);} 655 | '{' SourceElements '}' { $$ = new FunctionBodyNode($2); 656 DBG($$, @1, @3);} 821 '{' '}' /* not in spec */ { $$ = new FunctionBodyNode(0); DBG($$, @1, @2); } 822 | '{' SourceElements '}' { $$ = new FunctionBodyNode($2); DBG($$, @1, @3); } 657 823 ; 658 824 659 825 Program: 660 /* nothing, empty script */ { $$ = new ProgramNode(0); 661 Parser::accept($$); } 662 | SourceElements { $$ = new ProgramNode($1); 663 Parser::accept($$); } 826 /* not in spec */ { Parser::accept(new ProgramNode(0)); } 827 | SourceElements { Parser::accept(new ProgramNode($1)); } 664 828 ; 665 829 666 830 SourceElements: 667 SourceElement { $$ = new SourceElementsNode($1); }668 | SourceElements SourceElement { $$ = new SourceElementsNode($1, $2); }831 SourceElement { $$ = new SourceElementsNode($1); } 832 | SourceElements SourceElement { $$ = new SourceElementsNode($1, $2); } 669 833 ; 670 834 671 835 SourceElement: 672 FunctionDeclaration { $$ = $1; }673 | Statement { $$ = $1; }674 ; 675 836 FunctionDeclaration { $$ = $1; } 837 | Statement { $$ = $1; } 838 ; 839 676 840 %% 677 841 678 842 static bool makeAssignNode(Node*& result, Node *loc, Operator op, Node *expr) 679 843 { 680 Node *n = loc; 681 bool paren = n->isGroupNode(); 682 if (paren) 683 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 844 Node *n = loc->nodeInsideAllParens(); 684 845 685 846 if (!n->isLocation()) … … 703 864 static bool makePrefixNode(Node*& result, Node *expr, Operator op) 704 865 { 705 Node *n = expr; 706 bool paren = n->isGroupNode(); 707 if (paren) 708 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 866 Node *n = expr->nodeInsideAllParens(); 709 867 710 868 if (!n->isLocation()) … … 728 886 static bool makePostfixNode(Node*& result, Node *expr, Operator op) 729 887 { 730 Node *n = expr; 731 bool paren = n->isGroupNode(); 732 if (paren) 733 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 888 Node *n = expr->nodeInsideAllParens(); 734 889 735 890 if (!n->isLocation()) … … 753 908 static Node *makeFunctionCallNode(Node *func, ArgumentsNode *args) 754 909 { 755 Node *n = func; 756 bool paren = n->isGroupNode(); 757 if (paren) 758 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 910 Node *n = func->nodeInsideAllParens(); 759 911 760 912 if (!n->isLocation()) … … 765 917 } else if (n->isBracketAccessorNode()) { 766 918 BracketAccessorNode *bracket = static_cast<BracketAccessorNode *>(n); 767 if ( paren)919 if (n != func) 768 920 return new FunctionCallParenBracketNode(bracket->base(), bracket->subscript(), args); 769 921 else … … 772 924 assert(n->isDotAccessorNode()); 773 925 DotAccessorNode *dot = static_cast<DotAccessorNode *>(n); 774 if ( paren)926 if (n != func) 775 927 return new FunctionCallParenDotNode(dot->base(), dot->identifier(), args); 776 928 else … … 781 933 static Node *makeTypeOfNode(Node *expr) 782 934 { 783 Node *n = expr; 784 bool paren = n->isGroupNode(); 785 if (paren) 786 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 935 Node *n = expr->nodeInsideAllParens(); 787 936 788 937 if (n->isResolveNode()) { … … 795 944 static Node *makeDeleteNode(Node *expr) 796 945 { 797 Node *n = expr; 798 bool paren = n->isGroupNode(); 799 if (paren) 800 n = static_cast<GroupNode *>(n)->nodeInsideAllParens(); 946 Node *n = expr->nodeInsideAllParens(); 801 947 802 948 if (!n->isLocation()) … … 815 961 } 816 962 817 int yyerror 963 int yyerror(const char * /* s */) /* Called by yyparse on error */ 818 964 { 819 // fprintf(stderr, "ERROR: %s at line %d\n", 820 // s, KJS::Lexer::curr()->lineNo()); 965 // fprintf(stderr, "ERROR: %s at line %d\n", s, KJS::Lexer::curr()->lineNo()); 821 966 return 1; 822 967 } 823 968 824 969 /* may we automatically insert a semicolon ? */ 825 bool automatic()970 static bool allowAutomaticSemicolon() 826 971 { 827 if (yychar == '}' || yychar == 0) 828 return true; 829 else if (Lexer::curr()->prevTerminator()) 830 return true; 831 832 return false; 972 return yychar == '}' || yychar == 0 || Lexer::curr()->prevTerminator(); 833 973 } -
trunk/JavaScriptCore/kjs/nodes.cpp
r10636 r10646 60 60 if (exec->hadException()) { \ 61 61 setExceptionDetailsIfNeeded(exec); \ 62 return Completion(Throw, exec->exception()); \ 62 ValueImp *ex = exec->exception(); \ 63 exec->clearException(); \ 64 return Completion(Throw, ex); \ 63 65 } \ 64 66 if (Collector::outOfMemory()) \ … … 68 70 if (exec->hadException()) { \ 69 71 setExceptionDetailsIfNeeded(exec); \ 70 return exec->exception(); \72 return Undefined(); \ 71 73 } \ 72 74 if (Collector::outOfMemory()) \ … … 81 83 return List(); // will be picked up by KJS_CHECKEXCEPTION 82 84 83 #ifdef KJS_DEBUG_MEM84 std::list<Node *> * Node::s_nodes = 0L;85 #endif86 87 85 // ------------------------------ Node ----------------------------------------- 88 86 … … 99 97 } 100 98 101 #ifdef KJS_DEBUG_MEM102 void Node::finalCheck()103 {104 fprintf( stderr, "Node::finalCheck(): list count : %d\n", (int)s_nodes.size() );105 std::list<Node *>::iterator it = s_nodes->begin();106 for ( unsigned i = 0; it != s_nodes->end() ; ++it, ++i )107 fprintf( stderr, "[%d] Still having node %p (%s) (refcount %d)\n", i, (void*)*it, typeid( **it ).name(), (*it)->refcount );108 delete s_nodes;109 s_nodes = 0L;110 }111 #endif112 113 ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg)114 {115 return KJS::throwError(exec, e, msg, lineNo(), sourceId(), &sourceURL);116 }117 118 99 static void substitute(UString &string, const UString &substring) 119 100 { … … 121 102 assert(position != -1); 122 103 string = string.substr(0, position) + substring + string.substr(position + 2); 104 } 105 106 Completion Node::createErrorCompletion(ExecState *exec, ErrorType e, const char *msg) 107 { 108 return Completion(Throw, Error::create(exec, e, msg, lineNo(), sourceId(), &sourceURL)); 109 } 110 111 Completion Node::createErrorCompletion(ExecState *exec, ErrorType e, const char *msg, const Identifier &ident) 112 { 113 UString message = msg; 114 substitute(message, ident.ustring()); 115 return Completion(Throw, Error::create(exec, e, message, lineNo(), sourceId(), &sourceURL)); 116 } 117 118 ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg) 119 { 120 return KJS::throwError(exec, e, msg, lineNo(), sourceId(), &sourceURL); 123 121 } 124 122 … … 163 161 substitute(message, label.ustring()); 164 162 return KJS::throwError(exec, e, message, lineNo(), sourceId(), &sourceURL); 163 } 164 165 ValueImp *Node::throwUndefinedVariableError(ExecState *exec, const Identifier &ident) 166 { 167 return throwError(exec, ReferenceError, "Can't find variable: %s", ident); 165 168 } 166 169 … … 177 180 } 178 181 182 Node *Node::nodeInsideAllParens() 183 { 184 return this; 185 } 186 179 187 // ------------------------------ StatementNode -------------------------------- 180 188 … … 200 208 } 201 209 202 // return true if the debugger wants us to stop at this point203 bool StatementNode::abortStatement(ExecState *exec)204 {205 Debugger *dbg = exec->dynamicInterpreter()->imp()->debugger();206 if (dbg)207 return dbg->imp()->aborted();208 else209 return false;210 }211 212 210 void StatementNode::processFuncDecl(ExecState *exec) 213 211 { … … 216 214 // ------------------------------ NullNode ------------------------------------- 217 215 218 ValueImp *NullNode::evaluate(ExecState * /*exec*/)216 ValueImp *NullNode::evaluate(ExecState *) 219 217 { 220 218 return Null(); … … 223 221 // ------------------------------ BooleanNode ---------------------------------- 224 222 225 ValueImp *BooleanNode::evaluate(ExecState * /*exec*/)223 ValueImp *BooleanNode::evaluate(ExecState *) 226 224 { 227 225 return jsBoolean(value); … … 230 228 // ------------------------------ NumberNode ----------------------------------- 231 229 232 ValueImp *NumberNode::evaluate(ExecState * /*exec*/)230 ValueImp *NumberNode::evaluate(ExecState *) 233 231 { 234 232 return jsNumber(value); … … 237 235 // ------------------------------ StringNode ----------------------------------- 238 236 239 ValueImp *StringNode::evaluate(ExecState * /*exec*/)237 ValueImp *StringNode::evaluate(ExecState *) 240 238 { 241 239 return jsString(value); … … 263 261 264 262 // ------------------------------ ResolveNode ---------------------------------- 265 266 static ValueImp *undefinedVariableError(ExecState *exec, const Identifier &ident)267 {268 return throwError(exec, ReferenceError, "Can't find variable: " + ident.ustring());269 }270 263 271 264 // ECMA 11.1.2 & 10.1.4 … … 289 282 } while (iter != end); 290 283 291 return undefinedVariableError(exec, ident);284 return throwUndefinedVariableError(exec, ident); 292 285 } 293 286 … … 298 291 { 299 292 return group->evaluate(exec); 293 } 294 295 Node *GroupNode::nodeInsideAllParens() 296 { 297 Node *n = this; 298 do 299 n = static_cast<GroupNode *>(n)->group.get(); 300 while (n->isGroupNode()); 301 return n; 300 302 } 301 303 … … 373 375 374 376 // ECMA 11.1.5 375 ValueImp *PropertyNode::evaluate(ExecState * /*exec*/)377 ValueImp *PropertyNode::evaluate(ExecState *) 376 378 { 377 379 ValueImp *s; … … 415 417 // ------------------------------ ArgumentListNode ----------------------------- 416 418 417 ValueImp *ArgumentListNode::evaluate(ExecState * /*exec*/)419 ValueImp *ArgumentListNode::evaluate(ExecState *) 418 420 { 419 421 assert(0); 420 return NULL; // dummy, see evaluateList()422 return 0; // dummy, see evaluateList() 421 423 } 422 424 … … 437 439 // ------------------------------ ArgumentsNode -------------------------------- 438 440 439 ValueImp *ArgumentsNode::evaluate(ExecState * /*exec*/)441 ValueImp *ArgumentsNode::evaluate(ExecState *) 440 442 { 441 443 assert(0); 442 return NULL; // dummy, see evaluateList()444 return 0; // dummy, see evaluateList() 443 445 } 444 446 … … 549 551 } while (iter != end); 550 552 551 return undefinedVariableError(exec, ident);553 return throwUndefinedVariableError(exec, ident); 552 554 } 553 555 … … 672 674 } while (iter != end); 673 675 674 return undefinedVariableError(exec, m_ident);676 return throwUndefinedVariableError(exec, m_ident); 675 677 } 676 678 … … 903 905 } while (iter != end); 904 906 905 return undefinedVariableError(exec, m_ident);907 return throwUndefinedVariableError(exec, m_ident); 906 908 } 907 909 … … 978 980 KJS_CHECKEXCEPTIONVALUE 979 981 980 return jsNumber(v->toNumber(exec)); /* TODO: optimize */982 return jsNumber(v->toNumber(exec)); 981 983 } 982 984 … … 1292 1294 1293 1295 if (m_oper != OpEqual) 1294 return undefinedVariableError(exec, m_ident);1296 return throwUndefinedVariableError(exec, m_ident); 1295 1297 1296 1298 found: … … 1420 1422 Completion c = statement->execute(exec); 1421 1423 KJS_ABORTPOINT 1422 if (exec->hadException()) {1423 ValueImp *ex = exec->exception();1424 exec->clearException();1425 return Completion(Throw, ex);1426 }1427 1428 1424 if (c.complType() != Normal) 1429 1425 return c; … … 1437 1433 return c2; 1438 1434 1439 if (exec->hadException()) {1440 ValueImp *ex = exec->exception();1441 exec->clearException();1442 return Completion(Throw, ex);1443 }1444 1445 1435 if (c2.isValueCompletion()) 1446 1436 v = c2.value(); … … 1486 1476 // built-in properties of the global object with var declarations. 1487 1477 if (variable->getDirect(ident)) 1488 return NULL;1478 return 0; 1489 1479 val = Undefined(); 1490 1480 } … … 1590 1580 1591 1581 // ECMA 12.3 1592 Completion EmptyStatementNode::execute(ExecState * /*exec*/)1582 Completion EmptyStatementNode::execute(ExecState *) 1593 1583 { 1594 1584 return Completion(Normal); … … 1658 1648 if (!((c.complType() == Continue) && ls.contains(c.target()))) { 1659 1649 if ((c.complType() == Break) && ls.contains(c.target())) 1660 return Completion(Normal, NULL);1650 return Completion(Normal, 0); 1661 1651 if (c.complType() != Normal) 1662 1652 return c; … … 1666 1656 } while (bv->toBoolean(exec)); 1667 1657 1668 return Completion(Normal, NULL);1658 return Completion(Normal, 0); 1669 1659 } 1670 1660 … … 1684 1674 Completion c; 1685 1675 bool b(false); 1686 ValueImp *value = NULL;1676 ValueImp *value = 0; 1687 1677 1688 1678 while (1) { … … 1724 1714 Completion ForNode::execute(ExecState *exec) 1725 1715 { 1726 ValueImp *v, *cval = NULL;1716 ValueImp *v, *cval = 0; 1727 1717 1728 1718 if (expr1) { … … 1787 1777 { 1788 1778 ValueImp *e; 1789 ValueImp *retval = NULL;1779 ValueImp *retval = 0; 1790 1780 ObjectImp *v; 1791 1781 Completion c; … … 1804 1794 // access any property. 1805 1795 if (e->isUndefinedOrNull()) { 1806 return Completion(Normal, NULL);1796 return Completion(Normal, 0); 1807 1797 } 1808 1798 … … 1903 1893 1904 1894 if (ident.isEmpty() && !exec->context().imp()->seenLabels()->inIteration()) 1905 return Completion(Throw, 1906 throwError(exec, SyntaxError, "Invalid continue statement.")); 1895 return createErrorCompletion(exec, SyntaxError, "Invalid continue statement."); 1907 1896 else if (!ident.isEmpty() && !exec->context().imp()->seenLabels()->contains(ident)) 1908 return Completion(Throw, 1909 throwError(exec, SyntaxError, "Label %s not found.", ident)); 1897 return createErrorCompletion(exec, SyntaxError, "Label %s not found.", ident); 1910 1898 else 1911 return Completion(Continue, NULL, ident);1899 return Completion(Continue, 0, ident); 1912 1900 } 1913 1901 … … 1921 1909 if (ident.isEmpty() && !exec->context().imp()->seenLabels()->inIteration() && 1922 1910 !exec->context().imp()->seenLabels()->inSwitch()) 1923 return Completion(Throw, 1924 throwError(exec, SyntaxError, "Invalid break statement.")); 1911 return createErrorCompletion(exec, SyntaxError, "Invalid break statement."); 1925 1912 else if (!ident.isEmpty() && !exec->context().imp()->seenLabels()->contains(ident)) 1926 return Completion(Throw, 1927 throwError(exec, SyntaxError, "Label %s not found.", ident)); 1913 return createErrorCompletion(exec, SyntaxError, "Label %s not found."); 1928 1914 else 1929 return Completion(Break, NULL, ident);1915 return Completion(Break, 0, ident); 1930 1916 } 1931 1917 … … 1939 1925 CodeType codeType = exec->context().imp()->codeType(); 1940 1926 if (codeType != FunctionCode && codeType != AnonymousCode ) { 1941 return Completion(Throw, throwError(exec, SyntaxError, "Invalid return statement."));1927 return createErrorCompletion(exec, SyntaxError, "Invalid return statement."); 1942 1928 } 1943 1929 … … 2002 1988 // ------------------------------ ClauseListNode ------------------------------- 2003 1989 2004 ValueImp *ClauseListNode::evaluate(ExecState * /*exec*/)2005 { 2006 / * should never be called */1990 ValueImp *ClauseListNode::evaluate(ExecState *) 1991 { 1992 // should never be called 2007 1993 assert(false); 2008 return NULL;1994 return 0; 2009 1995 } 2010 1996 … … 2039 2025 } 2040 2026 2041 ValueImp *CaseBlockNode::evaluate(ExecState * /*exec*/)2042 { 2043 / * should never be called */2027 ValueImp *CaseBlockNode::evaluate(ExecState *) 2028 { 2029 // should never be called 2044 2030 assert(false); 2045 return NULL;2031 return 0; 2046 2032 } 2047 2033 … … 2148 2134 Completion LabelNode::execute(ExecState *exec) 2149 2135 { 2150 Completion e; 2151 2152 if (!exec->context().imp()->seenLabels()->push(label)) { 2153 return Completion( Throw, 2154 throwError(exec, SyntaxError, "Duplicated label %s found.", label)); 2155 }; 2156 e = statement->execute(exec); 2136 if (!exec->context().imp()->seenLabels()->push(label)) 2137 return createErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label); 2138 Completion e = statement->execute(exec); 2157 2139 exec->context().imp()->seenLabels()->pop(); 2158 2140 … … 2180 2162 } 2181 2163 2182 // ------------------------------ CatchNode ------------------------------------2183 2184 Completion CatchNode::execute(ExecState */*exec*/)2185 {2186 // should never be reached. execute(exec, arg) is used instead2187 assert(0L);2188 return Completion();2189 }2190 2191 // ECMA 12.142192 Completion CatchNode::execute(ExecState *exec, ValueImp *arg)2193 {2194 /* TODO: correct ? Not part of the spec */2195 2196 exec->clearException();2197 2198 ObjectImp *obj(new ObjectImp());2199 obj->put(exec, ident, arg, DontDelete);2200 exec->context().imp()->pushScope(obj);2201 Completion c = block->execute(exec);2202 exec->context().imp()->popScope();2203 2204 return c;2205 }2206 2207 void CatchNode::processVarDecls(ExecState *exec)2208 {2209 block->processVarDecls(exec);2210 }2211 2212 // ------------------------------ FinallyNode ----------------------------------2213 2214 // ECMA 12.142215 Completion FinallyNode::execute(ExecState *exec)2216 {2217 return block->execute(exec);2218 }2219 2220 void FinallyNode::processVarDecls(ExecState *exec)2221 {2222 block->processVarDecls(exec);2223 }2224 2225 2164 // ------------------------------ TryNode -------------------------------------- 2226 2165 … … 2230 2169 KJS_BREAKPOINT; 2231 2170 2232 Completion c, c2; 2233 2234 c = block->execute(exec); 2235 2236 if (!_final) { 2237 if (c.complType() != Throw) 2238 return c; 2239 return _catch->execute(exec,c.value()); 2240 } 2241 2242 if (!_catch) { 2243 ValueImp *lastException = exec->exception(); 2244 exec->clearException(); 2245 2246 c2 = _final->execute(exec); 2247 2248 if (!exec->hadException()) 2249 exec->setException(lastException); 2250 2251 return (c2.complType() == Normal) ? c : c2; 2252 } 2253 2254 if (c.complType() == Throw) 2255 c = _catch->execute(exec,c.value()); 2256 2257 c2 = _final->execute(exec); 2258 return (c2.complType() == Normal) ? c : c2; 2171 Completion c = tryBlock->execute(exec); 2172 2173 if (catchBlock && c.complType() == Throw) { 2174 ObjectImp *obj = new ObjectImp; 2175 obj->put(exec, exceptionIdent, c.value(), DontDelete); 2176 exec->context().imp()->pushScope(obj); 2177 c = catchBlock->execute(exec); 2178 exec->context().imp()->popScope(); 2179 } 2180 2181 if (finallyBlock) { 2182 Completion c2 = finallyBlock->execute(exec); 2183 if (c2.complType() != Normal) 2184 c = c2; 2185 } 2186 2187 return c; 2259 2188 } 2260 2189 2261 2190 void TryNode::processVarDecls(ExecState *exec) 2262 2191 { 2263 block->processVarDecls(exec);2264 if ( _final)2265 _final->processVarDecls(exec);2266 if ( _catch)2267 _catch->processVarDecls(exec);2192 tryBlock->processVarDecls(exec); 2193 if (catchBlock) 2194 catchBlock->processVarDecls(exec); 2195 if (finallyBlock) 2196 finallyBlock->processVarDecls(exec); 2268 2197 } 2269 2198 … … 2271 2200 2272 2201 // ECMA 13 2273 ValueImp *ParameterNode::evaluate(ExecState * /*exec*/)2202 ValueImp *ParameterNode::evaluate(ExecState *) 2274 2203 { 2275 2204 return Undefined(); … … 2282 2211 { 2283 2212 setLoc(-1, -1, -1); 2284 //fprintf(stderr,"FunctionBodyNode::FunctionBodyNode %p\n",this);2285 2213 } 2286 2214 … … 2299 2227 2300 2228 // TODO: let this be an object with [[Class]] property "Function" 2301 FunctionImp *fimp = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain()); 2302 ObjectImp *func(fimp); // protect from GC 2229 FunctionImp *func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain()); 2303 2230 2304 2231 ObjectImp *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty()); … … 2308 2235 int plen = 0; 2309 2236 for(ParameterNode *p = param.get(); p != 0L; p = p->nextParam(), plen++) 2310 f imp->addParameter(p->ident());2237 func->addParameter(p->ident()); 2311 2238 2312 2239 func->put(exec, lengthPropertyName, Number(plen), ReadOnly|DontDelete|DontEnum); … … 2327 2254 } 2328 2255 2256 Completion FuncDeclNode::execute(ExecState *) 2257 { 2258 return Completion(Normal); 2259 } 2260 2329 2261 // ------------------------------ FuncExprNode --------------------------------- 2330 2262 … … 2334 2266 ContextImp *context = exec->context().imp(); 2335 2267 bool named = !ident.isNull(); 2336 ObjectImp *functionScopeObject = NULL;2268 ObjectImp *functionScopeObject = 0; 2337 2269 2338 2270 if (named) { … … 2344 2276 } 2345 2277 2346 FunctionImp *fimp = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain()); 2347 ValueImp *ret(fimp); 2278 FunctionImp *func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain()); 2348 2279 ObjectImp *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty()); 2349 proto->put(exec, constructorPropertyName, ret, ReadOnly|DontDelete|DontEnum);2350 f imp->put(exec, prototypePropertyName, proto, Internal|DontDelete);2280 proto->put(exec, constructorPropertyName, func, ReadOnly|DontDelete|DontEnum); 2281 func->put(exec, prototypePropertyName, proto, Internal|DontDelete); 2351 2282 2352 2283 int plen = 0; 2353 2284 for(ParameterNode *p = param.get(); p != 0L; p = p->nextParam(), plen++) 2354 f imp->addParameter(p->ident());2285 func->addParameter(p->ident()); 2355 2286 2356 2287 if (named) { 2357 functionScopeObject->put(exec, ident, ret, Internal | ReadOnly | (context->codeType() == EvalCode ? 0 : DontDelete));2288 functionScopeObject->put(exec, ident, func, Internal | ReadOnly | (context->codeType() == EvalCode ? 0 : DontDelete)); 2358 2289 context->popScope(); 2359 2290 } 2360 2291 2361 return ret;2292 return func; 2362 2293 } 2363 2294 -
trunk/JavaScriptCore/kjs/nodes.h
r10634 r10646 30 30 31 31 #include "internal.h" 32 //#include "debugger.h"33 #ifndef NDEBUG34 #ifndef __osf__35 #include <list>36 #endif37 #endif38 32 39 33 namespace KJS { … … 86 80 UString toString() const; 87 81 virtual void streamTo(SourceStream &s) const = 0; 88 virtual void processVarDecls(ExecState * /*exec*/) {}82 virtual void processVarDecls(ExecState *) {} 89 83 int lineNo() const { return line; } 90 84 91 public:92 85 // reference counting mechanism 93 86 void ref() { ++m_refcount; } … … 95 88 unsigned int refcount() { return m_refcount; } 96 89 97 virtual bool isGroupNode() const { return false; }90 virtual Node *nodeInsideAllParens(); 98 91 99 92 virtual bool isLocation() const { return false; } … … 101 94 virtual bool isBracketAccessorNode() const { return false; } 102 95 virtual bool isDotAccessorNode() const { return false; } 96 virtual bool isGroupNode() const { return false; } 103 97 104 98 protected: 105 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg); 106 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *, Node *); 107 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg, const Identifier &); 108 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *, const Identifier &); 109 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *, Node *, Node *); 110 ValueImp *throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *, Node *, const Identifier &); 111 112 void setExceptionDetailsIfNeeded(ExecState *exec); 99 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg); 100 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &); 101 102 ValueImp *throwError(ExecState *, ErrorType, const char *msg); 103 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *); 104 ValueImp *throwError(ExecState *, ErrorType, const char *msg, const Identifier &); 105 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, const Identifier &); 106 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *, Node *); 107 ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *, const Identifier &); 108 109 ValueImp *throwUndefinedVariableError(ExecState *, const Identifier &); 110 111 void setExceptionDetailsIfNeeded(ExecState *); 112 113 113 int line; 114 114 UString sourceURL; 115 115 unsigned int m_refcount; 116 116 virtual int sourceId() const { return -1; } 117 117 118 private: 118 119 // disallow assignment … … 129 130 int sourceId() const { return sid; } 130 131 bool hitStatement(ExecState *exec); 131 bool abortStatement(ExecState *exec);132 132 virtual Completion execute(ExecState *exec) = 0; 133 133 void pushLabel(const Identifier &id) { ls.push(id); } … … 211 211 GroupNode(Node *g) : group(g) { } 212 212 virtual ValueImp *evaluate(ExecState *exec); 213 virtual void streamTo(SourceStream &s) const;214 213 virtual Node *nodeInsideAllParens(); 214 virtual void streamTo(SourceStream &s) const; 215 215 virtual bool isGroupNode() const { return true; } 216 Node *nodeInsideAllParens()217 {218 Node *n = group.get();219 while (n->isGroupNode()) {220 n = static_cast<GroupNode *>(n)->group.get();221 }222 return n;223 }224 225 216 private: 226 217 SharedPtr<Node> group; … … 1001 992 }; 1002 993 1003 class CatchNode : public StatementNode {1004 public:1005 CatchNode(const Identifier &i, StatementNode *b) : ident(i), block(b) {}1006 virtual Completion execute(ExecState *exec);1007 Completion execute(ExecState *exec, ValueImp *arg);1008 virtual void processVarDecls(ExecState *exec);1009 virtual void streamTo(SourceStream &s) const;1010 private:1011 Identifier ident;1012 SharedPtr<StatementNode> block;1013 };1014 1015 class FinallyNode : public StatementNode {1016 public:1017 FinallyNode(StatementNode *b) : block(b) {}1018 virtual Completion execute(ExecState *exec);1019 virtual void processVarDecls(ExecState *exec);1020 virtual void streamTo(SourceStream &s) const;1021 private:1022 SharedPtr<StatementNode> block;1023 };1024 1025 994 class TryNode : public StatementNode { 1026 995 public: 1027 TryNode(StatementNode *b, CatchNode *c) 1028 : block(b), _catch(c), _final(0) {} 1029 TryNode(StatementNode *b, FinallyNode *f) 1030 : block(b), _catch(0), _final(f) {} 1031 TryNode(StatementNode *b, CatchNode *c, FinallyNode *f) 1032 : block(b), _catch(c), _final(f) {} 1033 virtual Completion execute(ExecState *exec); 1034 virtual void processVarDecls(ExecState *exec); 1035 virtual void streamTo(SourceStream &s) const; 1036 private: 1037 SharedPtr<StatementNode> block; 1038 SharedPtr<CatchNode> _catch; 1039 SharedPtr<FinallyNode> _final; 996 TryNode(StatementNode *b, const Identifier &e, StatementNode *c, StatementNode *f) 997 : tryBlock(b), exceptionIdent(e), catchBlock(c), finallyBlock(f) { } 998 virtual Completion execute(ExecState *exec); 999 virtual void processVarDecls(ExecState *exec); 1000 virtual void streamTo(SourceStream &s) const; 1001 private: 1002 SharedPtr<StatementNode> tryBlock; 1003 Identifier exceptionIdent; 1004 SharedPtr<StatementNode> catchBlock; 1005 SharedPtr<StatementNode> finallyBlock; 1040 1006 }; 1041 1007 … … 1070 1036 FuncExprNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1071 1037 : ident(i), param(p->next), body(b) { p->next = 0; } 1072 ValueImp *evaluate(ExecState *exec); 1073 virtual void streamTo(SourceStream &s) const; 1074 1075 private: 1076 friend class FuncDeclNode; 1077 1038 virtual ValueImp *evaluate(ExecState *); 1039 virtual void streamTo(SourceStream &) const; 1040 private: 1078 1041 Identifier ident; 1079 1042 SharedPtr<ParameterNode> param; … … 1087 1050 FuncDeclNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1088 1051 : ident(i), param(p->next), body(b) { p->next = 0; } 1089 Completion execute(ExecState */*exec*/) 1090 { /* empty */ return Completion(); } 1091 void processFuncDecl(ExecState *exec); 1092 virtual void streamTo(SourceStream &s) const; 1052 virtual Completion execute(ExecState *); 1053 virtual void processFuncDecl(ExecState *); 1054 virtual void streamTo(SourceStream &) const; 1093 1055 private: 1094 1056 Identifier ident; -
trunk/JavaScriptCore/kjs/nodes2string.cpp
r10634 r10646 1 // -*- c-basic-offset: 2 -*-2 1 /* 3 2 * This file is part of the KDE libraries … … 665 664 } 666 665 667 void CatchNode::streamTo(SourceStream &s) const668 {669 s << SourceStream::Endl << "catch (" << ident << ")" << block;670 }671 672 void FinallyNode::streamTo(SourceStream &s) const673 {674 s << SourceStream::Endl << "finally " << block;675 }676 677 666 void TryNode::streamTo(SourceStream &s) const 678 667 { 679 s << "try " << block 680 << _catch 681 << _final; 668 s << "try " << tryBlock; 669 if (catchBlock) 670 s << SourceStream::Endl << "catch (" << exceptionIdent << ")" << catchBlock; 671 if (finallyBlock) 672 s << SourceStream::Endl << "finally " << finallyBlock; 682 673 } 683 674 … … 689 680 } 690 681 691 void FuncDeclNode::streamTo(SourceStream &s) const { 692 s << "function " << ident << "("; 693 if (param) 694 s << param; 695 s << ")" << body; 682 void FuncDeclNode::streamTo(SourceStream &s) const 683 { 684 s << "function " << ident << "(" << param << ")" << body; 696 685 } 697 686 698 687 void FuncExprNode::streamTo(SourceStream &s) const 699 688 { 700 s << "function " << "(" 701 << param 702 << ")" << body; 689 s << "function " << ident << "(" << param << ")" << body; 703 690 } 704 691 … … 708 695 s << n->element; 709 696 } 710 -
trunk/JavaScriptCore/tests/mozilla/expected.html
r10621 r10646 8 8 Test List: All tests<br> 9 9 Skip List: (none)<br> 10 1116 test(s) selected, 1111 test(s) completed, 9 4 failures reported (8.46% failed)<br>11 Engine command line: /Users/ mjs/Work/symroots/Development/testkjs <br>12 OS type: Darwin maciej-stachowiaks-powerbook-g4-17.local8.3.0 Darwin Kernel Version 8.3.0: Fri Sep 16 11:56:43 PDT 2005; root:xnu-792.6.17.obj~1/RELEASE_PPC Power Macintosh powerpc<br>13 Testcase execution time: 5 minutes, 56seconds.<br>14 Tests completed on Thu Sep 22 23:37:42 2005.<br><br>10 1116 test(s) selected, 1111 test(s) completed, 93 failures reported (8.37% failed)<br> 11 Engine command line: /Users/darin/symroots/Development/testkjs <br> 12 OS type: Darwin ap0101m-dhcp90.apple.com 8.3.0 Darwin Kernel Version 8.3.0: Fri Sep 16 11:56:43 PDT 2005; root:xnu-792.6.17.obj~1/RELEASE_PPC Power Macintosh powerpc<br> 13 Testcase execution time: 7 minutes, 54 seconds.<br> 14 Tests completed on Wed Sep 28 10:24:02 2005.<br><br> 15 15 [ <a href='#fail_detail'>Failure Details</a> | <a href='#retest_list'>Retest List</a> | <a href='menu.html'>Test Selection Page</a> ]<br> 16 16 <hr> … … 106 106 --> (Mon Feb 28 2000 15:59:59 GMT-0800).toLocaleTimeString() = 3:59:59 PM PST FAILED! expected: 15:59:59<br> 107 107 --> (Tue Feb 29 2000 00:00:00 GMT-0800).toLocaleTimeString() = 12:00:00 AM PST FAILED! expected: 00:00:00<br> 108 --> ( Thu Sep 22 2005 23:37:00 GMT-0700).toLocaleTimeString() = 11:37:00 PM PDT FAILED! expected: 23:37:00<br>109 --> ( Fri Sep 23 2005 07:37:00 GMT-0700).toLocaleTimeString() = 7:37:00 AM PDT FAILED! expected: 07:37:00<br>108 --> (Wed Sep 28 2005 10:22:52 GMT-0700).toLocaleTimeString() = 10:22:52 AM PDT FAILED! expected: 10:22:52<br> 109 --> (Wed Sep 28 2005 18:22:52 GMT-0700).toLocaleTimeString() = 6:22:52 PM PDT FAILED! expected: 18:22:52<br> 110 110 --> (Fri Dec 31 2004 16:00:00 GMT-0800).toLocaleTimeString() = 4:00:00 PM PST FAILED! expected: 16:00:00<br> 111 111 --> (Fri Dec 31 2004 15:59:59 GMT-0800).toLocaleTimeString() = 3:59:59 PM PST FAILED! expected: 15:59:59<br> … … 117 117 Testcase terminated with signal 0<br> 118 118 Complete testcase output was:<br> 119 --> STATUS: Function Expression Statements basic test.<br> 120 Exception, line 35: ReferenceError: Can't find variable: f<br> 119 Exception, line 26: SyntaxError: Parse error<br> 121 120 </tt><br> 122 121 <a name='failure10'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/Function/regress-58274.js'>ecma_3/Function/regress-58274.js</a> failed</b> <br> … … 352 351 --> FAILED!: Section 4 of test -<br> 353 352 --> FAILED!: regexp = /[ ]*(?:\([^\\-ÿ<br> 354 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 355 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 356 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 357 --> FAILED!: ()]*)*\)[ ]*)*(?:(?:[^( <>@,;:".\\\[\]<br> 358 --> FAILED!: "]*(?:\\[^-ÿ][^\\-ÿ<br> 359 --> FAILED!: "]*)*")[^()<>@,;:".\\\[\]-ÿ<br> 353 --> FAILED!: 354 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 355 --> FAILED!: 356 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 357 --> FAILED!: 358 ()]*)*\))[^\\-ÿ<br> 359 --> FAILED!: 360 ()]*)*\)[ ]*)*(?:(?:[^( <>@,;:".\\\[\]<br> 361 --> FAILED!: 362 "]*(?:\\[^-ÿ][^\\-ÿ<br> 363 --> FAILED!: 364 "]*)*")[^()<>@,;:".\\\[\]-ÿ<br> 360 365 --> FAILED!: -]*(?:(?:\([^\\-ÿ<br> 361 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 362 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 363 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 364 --> FAILED!: ()]*)*\)|"[^\\-ÿ<br> 365 --> FAILED!: "]*(?:\\[^-ÿ][^\\-ÿ<br> 366 --> FAILED!: "]*)*")[^()<>@,;:".\\\[\]-ÿ<br> 366 --> FAILED!: 367 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 368 --> FAILED!: 369 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 370 --> FAILED!: 371 ()]*)*\))[^\\-ÿ<br> 372 --> FAILED!: 373 ()]*)*\)|"[^\\-ÿ<br> 374 --> FAILED!: 375 "]*(?:\\[^-ÿ][^\\-ÿ<br> 376 --> FAILED!: 377 "]*)*")[^()<>@,;:".\\\[\]-ÿ<br> 367 378 --> FAILED!: -]*)*<[ ]*(?:\([^\\-ÿ<br> 368 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 369 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 370 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 371 --> FAILED!: ()]*)*\)[ ]*)*(?:@[ ]*(?:\([^\\-ÿ<br> 372 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 373 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 374 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 375 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 376 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 377 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 378 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 379 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 380 --> FAILED!: ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 381 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 382 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 383 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 384 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 385 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 386 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 387 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 388 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 389 --> FAILED!: ()]*)*\)[ ]*)*)*(?:,[ ]*(?:\([^\\-ÿ<br> 390 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 391 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 392 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 393 --> FAILED!: ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 394 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 395 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 396 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 397 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 398 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 399 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 400 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 401 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 402 --> FAILED!: ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 403 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 404 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 405 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 406 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 407 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 408 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 409 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 410 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 411 --> FAILED!: ()]*)*\)[ ]*)*)*)*:[ ]*(?:\([^\\-ÿ<br> 412 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 413 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 414 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 415 --> FAILED!: ()]*)*\)[ ]*)*)?(?:[^( <>@,;:".\\\[\]<br> 416 --> FAILED!: "]*(?:\\[^-ÿ][^\\-ÿ<br> 417 --> FAILED!: "]*)*")[ ]*(?:\([^\\-ÿ<br> 418 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 419 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 420 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 421 --> FAILED!: ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 422 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 423 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 424 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 425 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 426 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 427 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 428 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 429 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 430 --> FAILED!: ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 431 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 432 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 433 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 434 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 435 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 436 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 437 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 438 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 439 --> FAILED!: ()]*)*\)[ ]*)*)*>|(?:[^( <>@,;:".\\\[\]<br> 440 --> FAILED!: "]*(?:\\[^-ÿ][^\\-ÿ<br> 441 --> FAILED!: "]*)*")[ ]*(?:\([^\\-ÿ<br> 442 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 443 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 444 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 445 --> FAILED!: ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 446 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 447 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 448 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 449 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 450 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 451 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 452 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 453 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 454 --> FAILED!: ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 455 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 456 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 457 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 458 --> FAILED!: ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 459 --> FAILED!: \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 460 --> FAILED!: ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 461 --> FAILED!: ()]*(?:\\[^-ÿ][^\\-ÿ<br> 462 --> FAILED!: ()]*)*\))[^\\-ÿ<br> 463 --> FAILED!: ()]*)*\)[ ]*)*)*)/g<br> 379 --> FAILED!: 380 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 381 --> FAILED!: 382 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 383 --> FAILED!: 384 ()]*)*\))[^\\-ÿ<br> 385 --> FAILED!: 386 ()]*)*\)[ ]*)*(?:@[ ]*(?:\([^\\-ÿ<br> 387 --> FAILED!: 388 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 389 --> FAILED!: 390 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 391 --> FAILED!: 392 ()]*)*\))[^\\-ÿ<br> 393 --> FAILED!: 394 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 395 --> FAILED!: 396 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 397 --> FAILED!: 398 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 399 --> FAILED!: 400 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 401 --> FAILED!: 402 ()]*)*\))[^\\-ÿ<br> 403 --> FAILED!: 404 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 405 --> FAILED!: 406 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 407 --> FAILED!: 408 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 409 --> FAILED!: 410 ()]*)*\))[^\\-ÿ<br> 411 --> FAILED!: 412 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 413 --> FAILED!: 414 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 415 --> FAILED!: 416 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 417 --> FAILED!: 418 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 419 --> FAILED!: 420 ()]*)*\))[^\\-ÿ<br> 421 --> FAILED!: 422 ()]*)*\)[ ]*)*)*(?:,[ ]*(?:\([^\\-ÿ<br> 423 --> FAILED!: 424 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 425 --> FAILED!: 426 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 427 --> FAILED!: 428 ()]*)*\))[^\\-ÿ<br> 429 --> FAILED!: 430 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 431 --> FAILED!: 432 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 433 --> FAILED!: 434 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 435 --> FAILED!: 436 ()]*)*\))[^\\-ÿ<br> 437 --> FAILED!: 438 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 439 --> FAILED!: 440 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 441 --> FAILED!: 442 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 443 --> FAILED!: 444 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 445 --> FAILED!: 446 ()]*)*\))[^\\-ÿ<br> 447 --> FAILED!: 448 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 449 --> FAILED!: 450 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 451 --> FAILED!: 452 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 453 --> FAILED!: 454 ()]*)*\))[^\\-ÿ<br> 455 --> FAILED!: 456 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 457 --> FAILED!: 458 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 459 --> FAILED!: 460 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 461 --> FAILED!: 462 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 463 --> FAILED!: 464 ()]*)*\))[^\\-ÿ<br> 465 --> FAILED!: 466 ()]*)*\)[ ]*)*)*)*:[ ]*(?:\([^\\-ÿ<br> 467 --> FAILED!: 468 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 469 --> FAILED!: 470 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 471 --> FAILED!: 472 ()]*)*\))[^\\-ÿ<br> 473 --> FAILED!: 474 ()]*)*\)[ ]*)*)?(?:[^( <>@,;:".\\\[\]<br> 475 --> FAILED!: 476 "]*(?:\\[^-ÿ][^\\-ÿ<br> 477 --> FAILED!: 478 "]*)*")[ ]*(?:\([^\\-ÿ<br> 479 --> FAILED!: 480 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 481 --> FAILED!: 482 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 483 --> FAILED!: 484 ()]*)*\))[^\\-ÿ<br> 485 --> FAILED!: 486 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 487 --> FAILED!: 488 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 489 --> FAILED!: 490 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 491 --> FAILED!: 492 ()]*)*\))[^\\-ÿ<br> 493 --> FAILED!: 494 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 495 --> FAILED!: 496 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 497 --> FAILED!: 498 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 499 --> FAILED!: 500 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 501 --> FAILED!: 502 ()]*)*\))[^\\-ÿ<br> 503 --> FAILED!: 504 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 505 --> FAILED!: 506 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 507 --> FAILED!: 508 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 509 --> FAILED!: 510 ()]*)*\))[^\\-ÿ<br> 511 --> FAILED!: 512 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 513 --> FAILED!: 514 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 515 --> FAILED!: 516 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 517 --> FAILED!: 518 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 519 --> FAILED!: 520 ()]*)*\))[^\\-ÿ<br> 521 --> FAILED!: 522 ()]*)*\)[ ]*)*)*>|(?:[^( <>@,;:".\\\[\]<br> 523 --> FAILED!: 524 "]*(?:\\[^-ÿ][^\\-ÿ<br> 525 --> FAILED!: 526 "]*)*")[ ]*(?:\([^\\-ÿ<br> 527 --> FAILED!: 528 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 529 --> FAILED!: 530 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 531 --> FAILED!: 532 ()]*)*\))[^\\-ÿ<br> 533 --> FAILED!: 534 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br> 535 --> FAILED!: 536 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 537 --> FAILED!: 538 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 539 --> FAILED!: 540 ()]*)*\))[^\\-ÿ<br> 541 --> FAILED!: 542 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 543 --> FAILED!: 544 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 545 --> FAILED!: 546 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 547 --> FAILED!: 548 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 549 --> FAILED!: 550 ()]*)*\))[^\\-ÿ<br> 551 --> FAILED!: 552 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br> 553 --> FAILED!: 554 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 555 --> FAILED!: 556 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 557 --> FAILED!: 558 ()]*)*\))[^\\-ÿ<br> 559 --> FAILED!: 560 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br> 561 --> FAILED!: 562 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br> 563 --> FAILED!: 564 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br> 565 --> FAILED!: 566 ()]*(?:\\[^-ÿ][^\\-ÿ<br> 567 --> FAILED!: 568 ()]*)*\))[^\\-ÿ<br> 569 --> FAILED!: 570 ()]*)*\)[ ]*)*)*)/g<br> 464 571 --> FAILED!: string = 'Jeffy<"That Tall Guy"@ora.com (this address is no longer acti\ve)>'<br> 465 572 --> FAILED!: ERROR !!! regexp FAILED to match anything !!!<br> … … 672 779 --> FAILED!: [reported from test()] Actual: ["1.000,00", "", ",00"]<br> 673 780 --> FAILED!: [reported from test()] <br> 674 </tt><br>675 <a name='failure21'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/RegExp/regress-72964.js'>ecma_3/RegExp/regress-72964.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=72964' target='other_window'>Bug Number 72964</a><br>676 [ <a href='#failure20'>Previous Failure</a> | <a href='#failure22'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>677 <tt>--> STATUS: Testing regular expressions containing non-Latin1 characters<br>678 Failure messages were:<br>679 --> FAILED!: [reported from test()] Section 3 of test -<br>680 --> FAILED!: [reported from test()] regexp = /[\S]+/<br>681 --> FAILED!: [reported from test()] string = '<br>682 --> FAILED!: [reported from test()] ERROR !!! regexp FAILED to match anything !!!<br>683 --> FAILED!: [reported from test()] Expect: ["<br>684 --> FAILED!: [reported from test()] Actual: null<br>685 --> FAILED!: [reported from test()] <br>686 --> FAILED!: [reported from test()] Section 4 of test -<br>687 --> FAILED!: [reported from test()] regexp = /[\S]+/<br>688 --> FAILED!: [reported from test()] string = '<br>689 --> FAILED!: [reported from test()] ERROR !!! regexp FAILED to match anything !!!<br>690 --> FAILED!: [reported from test()] Expect: ["<br>691 --> FAILED!: [reported from test()] Actual: null<br>692 --> FAILED!: [reported from test()] <br>693 </tt><br>694 <a name='failure22'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/RegExp/regress-78156.js'>ecma_3/RegExp/regress-78156.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=78156' target='other_window'>Bug Number 78156</a><br>695 [ <a href='#failure21'>Previous Failure</a> | <a href='#failure23'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>696 <tt>--> STATUS: Testing regular expressions with ^, $, and the m flag -<br>697 Failure messages were:<br>698 --> FAILED!: [reported from test()] Section 2 of test -<br>699 --> FAILED!: [reported from test()] regexp = /\d$/gm<br>700 --> FAILED!: [reported from test()] string = 'aaa\n789\r\nccc\r\n345'<br>701 --> FAILED!: [reported from test()] ERROR !!! match arrays have different lengths:<br>702 --> FAILED!: [reported from test()] Expect: ["9", "5"]<br>703 --> FAILED!: [reported from test()] Actual: ["5"]<br>704 --> FAILED!: [reported from test()] <br>705 --> FAILED!: [reported from test()] Section 4 of test -<br>706 --> FAILED!: [reported from test()] regexp = /\d$/gm<br>707 --> FAILED!: [reported from test()] string = 'aaa\n789\r\nccc\r\nddd'<br>708 --> FAILED!: [reported from test()] ERROR !!! regexp FAILED to match anything !!!<br>709 --> FAILED!: [reported from test()] Expect: ["9"]<br>710 --> FAILED!: [reported from test()] Actual: null<br>711 --> FAILED!: [reported from test()] <br>712 </tt><br>713 <a name='failure23'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/RegExp/regress-85721.js'>ecma_3/RegExp/regress-85721.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=85721' target='other_window'>Bug Number 85721</a><br>714 [ <a href='#failure22'>Previous Failure</a> | <a href='#failure24'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>715 <tt>--> STATUS: Performance: execution of regular expression<br>716 Failure messages were:<br>717 --> FAILED!: Section 4 of test -<br>718 --> FAILED!: regexp = /[ ]*(?:\([^\\-ÿ<br>719 --> FAILED!:720 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>721 --> FAILED!:722 ()]*(?:\\[^-ÿ][^\\-ÿ<br>723 --> FAILED!:724 ()]*)*\))[^\\-ÿ<br>725 --> FAILED!:726 ()]*)*\)[ ]*)*(?:(?:[^( <>@,;:".\\\[\]<br>727 --> FAILED!:728 "]*(?:\\[^-ÿ][^\\-ÿ<br>729 --> FAILED!:730 "]*)*")[^()<>@,;:".\\\[\]-ÿ<br>731 --> FAILED!: -]*(?:(?:\([^\\-ÿ<br>732 --> FAILED!:733 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>734 --> FAILED!:735 ()]*(?:\\[^-ÿ][^\\-ÿ<br>736 --> FAILED!:737 ()]*)*\))[^\\-ÿ<br>738 --> FAILED!:739 ()]*)*\)|"[^\\-ÿ<br>740 --> FAILED!:741 "]*(?:\\[^-ÿ][^\\-ÿ<br>742 --> FAILED!:743 "]*)*")[^()<>@,;:".\\\[\]-ÿ<br>744 --> FAILED!: -]*)*<[ ]*(?:\([^\\-ÿ<br>745 --> FAILED!:746 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>747 --> FAILED!:748 ()]*(?:\\[^-ÿ][^\\-ÿ<br>749 --> FAILED!:750 ()]*)*\))[^\\-ÿ<br>751 --> FAILED!:752 ()]*)*\)[ ]*)*(?:@[ ]*(?:\([^\\-ÿ<br>753 --> FAILED!:754 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>755 --> FAILED!:756 ()]*(?:\\[^-ÿ][^\\-ÿ<br>757 --> FAILED!:758 ()]*)*\))[^\\-ÿ<br>759 --> FAILED!:760 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>761 --> FAILED!:762 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>763 --> FAILED!:764 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>765 --> FAILED!:766 ()]*(?:\\[^-ÿ][^\\-ÿ<br>767 --> FAILED!:768 ()]*)*\))[^\\-ÿ<br>769 --> FAILED!:770 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br>771 --> FAILED!:772 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>773 --> FAILED!:774 ()]*(?:\\[^-ÿ][^\\-ÿ<br>775 --> FAILED!:776 ()]*)*\))[^\\-ÿ<br>777 --> FAILED!:778 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>779 --> FAILED!:780 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>781 --> FAILED!:782 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>783 --> FAILED!:784 ()]*(?:\\[^-ÿ][^\\-ÿ<br>785 --> FAILED!:786 ()]*)*\))[^\\-ÿ<br>787 --> FAILED!:788 ()]*)*\)[ ]*)*)*(?:,[ ]*(?:\([^\\-ÿ<br>789 --> FAILED!:790 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>791 --> FAILED!:792 ()]*(?:\\[^-ÿ][^\\-ÿ<br>793 --> FAILED!:794 ()]*)*\))[^\\-ÿ<br>795 --> FAILED!:796 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br>797 --> FAILED!:798 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>799 --> FAILED!:800 ()]*(?:\\[^-ÿ][^\\-ÿ<br>801 --> FAILED!:802 ()]*)*\))[^\\-ÿ<br>803 --> FAILED!:804 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>805 --> FAILED!:806 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>807 --> FAILED!:808 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>809 --> FAILED!:810 ()]*(?:\\[^-ÿ][^\\-ÿ<br>811 --> FAILED!:812 ()]*)*\))[^\\-ÿ<br>813 --> FAILED!:814 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br>815 --> FAILED!:816 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>817 --> FAILED!:818 ()]*(?:\\[^-ÿ][^\\-ÿ<br>819 --> FAILED!:820 ()]*)*\))[^\\-ÿ<br>821 --> FAILED!:822 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>823 --> FAILED!:824 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>825 --> FAILED!:826 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>827 --> FAILED!:828 ()]*(?:\\[^-ÿ][^\\-ÿ<br>829 --> FAILED!:830 ()]*)*\))[^\\-ÿ<br>831 --> FAILED!:832 ()]*)*\)[ ]*)*)*)*:[ ]*(?:\([^\\-ÿ<br>833 --> FAILED!:834 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>835 --> FAILED!:836 ()]*(?:\\[^-ÿ][^\\-ÿ<br>837 --> FAILED!:838 ()]*)*\))[^\\-ÿ<br>839 --> FAILED!:840 ()]*)*\)[ ]*)*)?(?:[^( <>@,;:".\\\[\]<br>841 --> FAILED!:842 "]*(?:\\[^-ÿ][^\\-ÿ<br>843 --> FAILED!:844 "]*)*")[ ]*(?:\([^\\-ÿ<br>845 --> FAILED!:846 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>847 --> FAILED!:848 ()]*(?:\\[^-ÿ][^\\-ÿ<br>849 --> FAILED!:850 ()]*)*\))[^\\-ÿ<br>851 --> FAILED!:852 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br>853 --> FAILED!:854 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>855 --> FAILED!:856 ()]*(?:\\[^-ÿ][^\\-ÿ<br>857 --> FAILED!:858 ()]*)*\))[^\\-ÿ<br>859 --> FAILED!:860 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>861 --> FAILED!:862 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>863 --> FAILED!:864 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>865 --> FAILED!:866 ()]*(?:\\[^-ÿ][^\\-ÿ<br>867 --> FAILED!:868 ()]*)*\))[^\\-ÿ<br>869 --> FAILED!:870 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br>871 --> FAILED!:872 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>873 --> FAILED!:874 ()]*(?:\\[^-ÿ][^\\-ÿ<br>875 --> FAILED!:876 ()]*)*\))[^\\-ÿ<br>877 --> FAILED!:878 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>879 --> FAILED!:880 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>881 --> FAILED!:882 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>883 --> FAILED!:884 ()]*(?:\\[^-ÿ][^\\-ÿ<br>885 --> FAILED!:886 ()]*)*\))[^\\-ÿ<br>887 --> FAILED!:888 ()]*)*\)[ ]*)*)*>|(?:[^( <>@,;:".\\\[\]<br>889 --> FAILED!:890 "]*(?:\\[^-ÿ][^\\-ÿ<br>891 --> FAILED!:892 "]*)*")[ ]*(?:\([^\\-ÿ<br>893 --> FAILED!:894 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>895 --> FAILED!:896 ()]*(?:\\[^-ÿ][^\\-ÿ<br>897 --> FAILED!:898 ()]*)*\))[^\\-ÿ<br>899 --> FAILED!:900 ()]*)*\)[ ]*)*@[ ]*(?:\([^\\-ÿ<br>901 --> FAILED!:902 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>903 --> FAILED!:904 ()]*(?:\\[^-ÿ][^\\-ÿ<br>905 --> FAILED!:906 ()]*)*\))[^\\-ÿ<br>907 --> FAILED!:908 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>909 --> FAILED!:910 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>911 --> FAILED!:912 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>913 --> FAILED!:914 ()]*(?:\\[^-ÿ][^\\-ÿ<br>915 --> FAILED!:916 ()]*)*\))[^\\-ÿ<br>917 --> FAILED!:918 ()]*)*\)[ ]*)*(?:.[ ]*(?:\([^\\-ÿ<br>919 --> FAILED!:920 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>921 --> FAILED!:922 ()]*(?:\\[^-ÿ][^\\-ÿ<br>923 --> FAILED!:924 ()]*)*\))[^\\-ÿ<br>925 --> FAILED!:926 ()]*)*\)[ ]*)*(?:[^( <>@,;:".\\\[\]<br>927 --> FAILED!:928 \[\]]|\\[^-ÿ])*\])[ ]*(?:\([^\\-ÿ<br>929 --> FAILED!:930 ()]*(?:(?:\\[^-ÿ]|\([^\\-ÿ<br>931 --> FAILED!:932 ()]*(?:\\[^-ÿ][^\\-ÿ<br>933 --> FAILED!:934 ()]*)*\))[^\\-ÿ<br>935 --> FAILED!:936 ()]*)*\)[ ]*)*)*)/g<br>937 --> FAILED!: string = 'Jeffy<"That Tall Guy"@ora.com (this address is no longer acti\ve)>'<br>938 --> FAILED!: ERROR !!! regexp FAILED to match anything !!!<br>939 --> FAILED!: Expect: ["Jeffy<"That Tall Guy"@ora.com (this address is no longer active)>"]<br>940 --> FAILED!: Actual: null<br>941 --> FAILED!: <br>942 781 </tt><br> 943 782 <a name='failure24'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/Statements/regress-194364.js'>ecma_3/Statements/regress-194364.js</a> failed</b> <br> … … 1478 1317 Exception, line 351: SyntaxError: Parse error<br> 1479 1318 </tt><br> 1480 <a name='failure86'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-1 14491.js'>js1_5/Regress/regress-114491.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=114491' target='other_window'>Bug Number 114491</a><br>1319 <a name='failure86'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-127557.js'>js1_5/Regress/regress-127557.js</a> failed</b> <br> 1481 1320 [ <a href='#failure85'>Previous Failure</a> | <a href='#failure87'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1482 <tt>--> STATUS: Regression test for bug 114491<br> 1483 Failure messages were:<br> 1484 --> FAILED!: [reported from test()] Section 1 of test -<br> 1485 --> FAILED!: [reported from test()] Expected value 'Program execution fell into into catch-block', Actual value 'Program execution did NOT fall into catch-block'<br> 1486 --> FAILED!: [reported from test()] <br> 1487 </tt><br> 1488 <a name='failure87'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-127557.js'>js1_5/Regress/regress-127557.js</a> failed</b> <br> 1321 <tt>Expected exit code 0, got 3<br> 1322 Testcase terminated with signal 0<br> 1323 Complete testcase output was:<br> 1324 Exception, line 76: ReferenceError: Can't find variable: clone<br> 1325 </tt><br> 1326 <a name='failure87'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-156354.js'>js1_5/Regress/regress-156354.js</a> failed</b> <br> 1489 1327 [ <a href='#failure86'>Previous Failure</a> | <a href='#failure88'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1490 1328 <tt>Expected exit code 0, got 3<br> 1491 1329 Testcase terminated with signal 0<br> 1492 1330 Complete testcase output was:<br> 1493 Exception, line 76: ReferenceError: Can't find variable: clone<br>1494 </tt><br> 1495 <a name='failure88'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-1 56354.js'>js1_5/Regress/regress-156354.js</a> failed</b> <br>1331 Exception, line 56: TypeError: Value undefined (result of expression this.propertyIsEnumerable) is not object.<br> 1332 </tt><br> 1333 <a name='failure88'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-172699.js'>js1_5/Regress/regress-172699.js</a> failed</b> <br> 1496 1334 [ <a href='#failure87'>Previous Failure</a> | <a href='#failure89'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1497 1335 <tt>Expected exit code 0, got 3<br> 1498 1336 Testcase terminated with signal 0<br> 1499 1337 Complete testcase output was:<br> 1500 Exception, line 56: TypeError: Value undefined (result of expression this.propertyIsEnumerable) is not object.<br>1501 </tt><br> 1502 <a name='failure89'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-17 2699.js'>js1_5/Regress/regress-172699.js</a> failed</b><br>1338 Exception, line 62: URIError: URI error<br> 1339 </tt><br> 1340 <a name='failure89'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-179524.js'>js1_5/Regress/regress-179524.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=179524' target='other_window'>Bug Number 179524</a><br> 1503 1341 [ <a href='#failure88'>Previous Failure</a> | <a href='#failure90'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1504 <tt>Expected exit code 0, got 3<br>1505 Testcase terminated with signal 0<br>1506 Complete testcase output was:<br>1507 Exception, line 62: URIError: URI error<br>1508 </tt><br>1509 <a name='failure90'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-179524.js'>js1_5/Regress/regress-179524.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=179524' target='other_window'>Bug Number 179524</a><br>1510 [ <a href='#failure89'>Previous Failure</a> | <a href='#failure91'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>1511 1342 <tt>--> STATUS: Don't crash on extraneous arguments to str.match(), etc.<br> 1512 1343 Failure messages were:<br> … … 1558 1389 --> FAILED!: [reported from test()] <br> 1559 1390 </tt><br> 1560 <a name='failure9 1'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-185165.js'>js1_5/Regress/regress-185165.js</a> failed</b> <br>1561 [ <a href='#failure 90'>Previous Failure</a> | <a href='#failure92'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>1391 <a name='failure90'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-185165.js'>js1_5/Regress/regress-185165.js</a> failed</b> <br> 1392 [ <a href='#failure89'>Previous Failure</a> | <a href='#failure91'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1562 1393 <tt>Expected exit code 0, got 3<br> 1563 1394 Testcase terminated with signal 0<br> … … 1566 1397 Exception, line 3: SyntaxError: Parse error<br> 1567 1398 </tt><br> 1568 <a name='failure9 2'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/regress-185485.js'>js1_5/Scope/regress-185485.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=185485' target='other_window'>Bug Number 185485</a><br>1569 [ <a href='#failure9 1'>Previous Failure</a> | <a href='#failure93'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>1399 <a name='failure91'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/regress-185485.js'>js1_5/Scope/regress-185485.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=185485' target='other_window'>Bug Number 185485</a><br> 1400 [ <a href='#failure90'>Previous Failure</a> | <a href='#failure92'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1570 1401 <tt>--> STATUS: Testing |with (x) {function f() {}}| when |x.f| already exists<br> 1571 1402 Failure messages were:<br> … … 1582 1413 --> FAILED!: [reported from test()] <br> 1583 1414 </tt><br> 1584 <a name='failure93'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/regress-220584.js'>js1_5/Scope/regress-220584.js</a> failed</b> <br> 1415 <a name='failure92'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/regress-220584.js'>js1_5/Scope/regress-220584.js</a> failed</b> <br> 1416 [ <a href='#failure91'>Previous Failure</a> | <a href='#failure93'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1417 <tt>Expected exit code 0, got 3<br> 1418 Testcase terminated with signal 0<br> 1419 Complete testcase output was:<br> 1420 Exception, line 57: ReferenceError: Can't find variable: Script<br> 1421 </tt><br> 1422 <a name='failure93'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/scope-001.js'>js1_5/Scope/scope-001.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=53268' target='other_window'>Bug Number 53268</a><br> 1585 1423 [ <a href='#failure92'>Previous Failure</a> | <a href='#failure94'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br> 1586 <tt>Expected exit code 0, got 3<br>1587 Testcase terminated with signal 0<br>1588 Complete testcase output was:<br>1589 Exception, line 57: ReferenceError: Can't find variable: Script<br>1590 </tt><br>1591 <a name='failure94'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/scope-001.js'>js1_5/Scope/scope-001.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=53268' target='other_window'>Bug Number 53268</a><br>1592 [ <a href='#failure93'>Previous Failure</a> | <a href='#failure95'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>1593 1424 <tt>--> STATUS: Testing scope after changing obj.__proto__<br> 1594 1425 Failure messages were:<br> … … 1607 1438 <a name='retest_list'></a> 1608 1439 <h2>Retest List</h2><br> 1609 # Retest List, kjs, generated Thu Sep 22 23:37:42 2005.1440 # Retest List, kjs, generated Wed Sep 28 10:24:02 2005. 1610 1441 # Original test base was: All tests. 1611 # 1111 of 1116 test(s) were completed, 9 4failures reported.1442 # 1111 of 1116 test(s) were completed, 93 failures reported. 1612 1443 ecma/Date/15.9.5.28-1.js 1613 1444 ecma/GlobalObject/15.1.2.2-2.js … … 1695 1526 js1_5/Regress/regress-103602.js 1696 1527 js1_5/Regress/regress-104077.js 1697 js1_5/Regress/regress-114491.js1698 1528 js1_5/Regress/regress-127557.js 1699 1529 js1_5/Regress/regress-156354.js
Note:
See TracChangeset
for help on using the changeset viewer.