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

Unified Diff: src/parser.cc

Issue 653603002: Try to fix cross-script global scope (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/mirror-debugger.js ('k') | src/runtime.h » ('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 6886fcca2a0419281270fcecc70c5e54a9307b0d..ad6a2981126d83370ed2b9e325a638e9b742abe4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -801,12 +801,11 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
ast_value_factory_->Internalize(isolate());
}
original_scope_ = scope;
- if (info->is_eval()) {
- if (!scope->is_global_scope() || info->strict_mode() == STRICT) {
- scope = NewScope(scope, EVAL_SCOPE);
- }
+ if (info->is_eval() &&
+ (!scope->is_global_scope() || info->strict_mode() == STRICT)) {
+ scope = NewScope(scope, EVAL_SCOPE);
} else if (info->is_global()) {
- scope = NewScope(scope, GLOBAL_SCOPE);
+ scope = NewScope(scope, SCRIPT_SCOPE);
}
scope->set_start_position(0);
scope->set_end_position(source->length());
@@ -1401,8 +1400,6 @@ Statement* Parser::ParseExportDeclaration(bool* ok) {
//
// TODO(ES6): implement structuring ExportSpecifiers
- ASSERT(strict_mode() == STRICT);
-
Expect(Token::EXPORT, CHECK_OK);
Statement* result = NULL;
« no previous file with comments | « src/mirror-debugger.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698