Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 96d07a859b296b5223d7355f56d1fbb591535b17..5b7546ef5e9a1e99afbc490645951d80b61cd674 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -7553,7 +7553,8 @@ static MaybeObject* Runtime_CompileString(Arguments args) { |
| Handle<Context> context(Top::context()->global_context()); |
| Handle<SharedFunctionInfo> shared = Compiler::CompileEval(source, |
| context, |
| - true); |
| + true, |
| + false); |
| if (shared.is_null()) return Failure::Exception(); |
| Handle<JSFunction> fun = |
| Factory::NewFunctionFromSharedFunctionInfo(shared, context, NOT_TENURED); |
| @@ -7562,13 +7563,15 @@ static MaybeObject* Runtime_CompileString(Arguments args) { |
| static ObjectPair CompileGlobalEval(Handle<String> source, |
| - Handle<Object> receiver) { |
| + Handle<Object> receiver, |
| + bool is_strict) { |
| // Deal with a normal eval call with a string argument. Compile it |
| // and return the compiled function bound in the local context. |
| Handle<SharedFunctionInfo> shared = Compiler::CompileEval( |
| source, |
| Handle<Context>(Top::context()), |
| - Top::context()->IsGlobalContext()); |
| + Top::context()->IsGlobalContext(), |
| + is_strict); |
| if (shared.is_null()) return MakePair(Failure::Exception(), NULL); |
| Handle<JSFunction> compiled = Factory::NewFunctionFromSharedFunctionInfo( |
| shared, |
| @@ -7579,7 +7582,7 @@ static ObjectPair CompileGlobalEval(Handle<String> source, |
| static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) { |
| - ASSERT(args.length() == 3); |
| + ASSERT(args.length() == 4); |
| if (!args[0]->IsJSFunction()) { |
| return MakePair(Top::ThrowIllegalOperation(), NULL); |
| } |
| @@ -7643,12 +7646,15 @@ static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) { |
| return MakePair(*callee, Top::context()->global()->global_receiver()); |
| } |
| - return CompileGlobalEval(args.at<String>(1), args.at<Object>(2)); |
| + ASSERT(args[3]->IsSmi()); |
| + return CompileGlobalEval(args.at<String>(1), |
| + args.at<Object>(2), |
| + Smi::cast(args[3])->value() != 0); |
| } |
| static ObjectPair Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) { |
| - ASSERT(args.length() == 3); |
| + ASSERT(args.length() == 4); |
| if (!args[0]->IsJSFunction()) { |
| return MakePair(Top::ThrowIllegalOperation(), NULL); |
| } |
| @@ -7663,7 +7669,10 @@ static ObjectPair Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) { |
| return MakePair(*callee, Top::context()->global()->global_receiver()); |
| } |
| - return CompileGlobalEval(args.at<String>(1), args.at<Object>(2)); |
| + ASSERT(args[3]->IsSmi()); |
| + return CompileGlobalEval(args.at<String>(1), |
| + args.at<Object>(2), |
| + Smi::cast(args[3])->value() != 0); |
| } |
| @@ -9803,7 +9812,8 @@ static MaybeObject* Runtime_DebugEvaluate(Arguments args) { |
| Handle<SharedFunctionInfo> shared = |
| Compiler::CompileEval(function_source, |
| context, |
| - context->IsGlobalContext()); |
| + context->IsGlobalContext(), |
| + false); |
|
Lasse Reichstein
2011/02/03 12:36:01
It deserves a comment that we always run the code
Martin Maly
2011/02/04 01:02:34
Done.
|
| if (shared.is_null()) return Failure::Exception(); |
| Handle<JSFunction> compiled_function = |
| Factory::NewFunctionFromSharedFunctionInfo(shared, context); |
| @@ -9886,9 +9896,7 @@ static MaybeObject* Runtime_DebugEvaluateGlobal(Arguments args) { |
| // Compile the source to be evaluated. |
| Handle<SharedFunctionInfo> shared = |
| - Compiler::CompileEval(source, |
| - context, |
| - is_global); |
| + Compiler::CompileEval(source, context, is_global, false); |
| if (shared.is_null()) return Failure::Exception(); |
| Handle<JSFunction> compiled_function = |
| Handle<JSFunction>(Factory::NewFunctionFromSharedFunctionInfo(shared, |