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

Unified Diff: src/runtime.cc

Issue 165446: Fixed issue 19212 (Closed)
Patch Set: Fixed lint problem Created 11 years, 4 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/compiler.cc ('k') | test/mjsunit/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 56e9f85ebe153b17adda839b9d31e64f9deb2a83..0da4be8216e4f07738aa46847c7f901ba7e7cabf 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4973,10 +4973,12 @@ static Object* Runtime_CompileString(Arguments args) {
// Compile source string in the global context.
Handle<Context> context(Top::context()->global_context());
+ Compiler::ValidationState validate = (is_json->IsTrue())
+ ? Compiler::VALIDATE_JSON : Compiler::DONT_VALIDATE_JSON;
Handle<JSFunction> boilerplate = Compiler::CompileEval(source,
context,
true,
- is_json->IsTrue());
+ validate);
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> fun =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
@@ -5000,8 +5002,11 @@ static Object* CompileDirectEval(Handle<String> source) {
bool is_global = context->IsGlobalContext();
// Compile source string in the current context.
- Handle<JSFunction> boilerplate =
- Compiler::CompileEval(source, context, is_global, false);
+ Handle<JSFunction> boilerplate = Compiler::CompileEval(
+ source,
+ context,
+ is_global,
+ Compiler::DONT_VALIDATE_JSON);
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> fun =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
@@ -7043,7 +7048,7 @@ static Object* Runtime_DebugEvaluate(Arguments args) {
Compiler::CompileEval(function_source,
context,
context->IsGlobalContext(),
- false);
+ Compiler::DONT_VALIDATE_JSON);
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> compiled_function =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
@@ -7111,7 +7116,7 @@ static Object* Runtime_DebugEvaluateGlobal(Arguments args) {
Handle<JSFunction>(Compiler::CompileEval(source,
context,
true,
- false));
+ Compiler::DONT_VALIDATE_JSON));
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> compiled_function =
Handle<JSFunction>(Factory::NewFunctionFromBoilerplate(boilerplate,
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698