Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: src/preparser.h

Issue 27025002: Fix pre-parsing of 'use strict' directive after string literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-parse-use-strict.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 return Statement(kUseStrictExpressionStatement); 437 return Statement(kUseStrictExpressionStatement);
438 } 438 }
439 if (expression.IsStringLiteral()) { 439 if (expression.IsStringLiteral()) {
440 return Statement(kStringLiteralExpressionStatement); 440 return Statement(kStringLiteralExpressionStatement);
441 } 441 }
442 } 442 }
443 return Default(); 443 return Default();
444 } 444 }
445 445
446 bool IsStringLiteral() { 446 bool IsStringLiteral() {
447 return code_ != kUnknownStatement; 447 return code_ == kStringLiteralExpressionStatement;
448 } 448 }
449 449
450 bool IsUseStrictLiteral() { 450 bool IsUseStrictLiteral() {
451 return code_ == kUseStrictExpressionStatement; 451 return code_ == kUseStrictExpressionStatement;
452 } 452 }
453 453
454 bool IsFunctionDeclaration() { 454 bool IsFunctionDeclaration() {
455 return code_ == kFunctionDeclaration; 455 return code_ == kFunctionDeclaration;
456 } 456 }
457 457
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 bool allow_generators_; 689 bool allow_generators_;
690 bool allow_for_of_; 690 bool allow_for_of_;
691 bool parenthesized_function_; 691 bool parenthesized_function_;
692 692
693 friend class i::ObjectLiteralChecker<PreParser>; 693 friend class i::ObjectLiteralChecker<PreParser>;
694 }; 694 };
695 695
696 } } // v8::preparser 696 } } // v8::preparser
697 697
698 #endif // V8_PREPARSER_H 698 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-parse-use-strict.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698