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

Unified Diff: src/parser.cc

Issue 8306025: Disallow function declarations in statement positions in harmony mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/block-let-declaration.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index dc8cec240fa8f9329519eafacd6c9f7b71c2e107..6df216dc32c4d4406086f98fc84e511afcb32b98 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -1334,7 +1334,7 @@ Statement* Parser::ParseStatement(ZoneStringList* labels, bool* ok) {
// FunctionDeclaration
// Common language extension is to allow function declaration in place
// of any statement. This language extension is disabled in strict mode.
- if (top_scope_->is_strict_mode()) {
+ if (top_scope_->is_strict_mode() || harmony_scoping_) {
Lasse Reichstein 2011/10/17 11:31:45 Ditto for the preparser?
Steven 2011/10/17 11:57:22 Oops, indeed. Done. On 2011/10/17 11:31:45, Lasse
ReportMessageAt(scanner().peek_location(), "strict_function",
Vector<const char*>::empty());
*ok = false;
« no previous file with comments | « no previous file | test/mjsunit/harmony/block-let-declaration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698