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

Unified Diff: src/compiler.cc

Issue 9415010: Make built-ins strict mode conforming, and support a --use-strict flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Yang's comments. Created 8 years, 10 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/collection.js ('k') | src/d8.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 629155e78138f6efc2b7966396f780850f846d43..e94d520640f1b28ffb77cc3c7d13995dc9f38e8b 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -500,13 +500,6 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
// for small sources, odds are that there aren't many functions
// that would be compiled lazily anyway, so we skip the preparse step
// in that case too.
- int flags = kNoParsingFlags;
- if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) {
- flags |= kAllowNativesSyntax;
- }
- if (natives != NATIVES_CODE && FLAG_harmony_scoping) {
- flags |= EXTENDED_MODE;
- }
// Create a script object describing the script to be compiled.
Handle<Script> script = FACTORY->NewScript(source);
@@ -527,6 +520,7 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
info.MarkAsGlobal();
info.SetExtension(extension);
info.SetPreParseData(pre_data);
+ if (FLAG_use_strict) info.SetLanguageMode(STRICT_MODE);
result = MakeFunctionInfo(&info);
if (extension == NULL && !result.is_null()) {
compilation_cache->PutScript(source, result);
« no previous file with comments | « src/collection.js ('k') | src/d8.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698