Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 96d07a859b296b5223d7355f56d1fbb591535b17..4d5c3bfbdaea7ae8a6a8d73978d8cae1d51692d0 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 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(), |
| + 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,7 +7646,10 @@ 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()); |
| } |
| @@ -7663,7 +7669,7 @@ static ObjectPair Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) { |
| return MakePair(*callee, Top::context()->global()->global_receiver()); |
| } |
| - return CompileGlobalEval(args.at<String>(1), args.at<Object>(2)); |
| + return CompileGlobalEval(args.at<String>(1), args.at<Object>(2), false); |
| } |
| @@ -9803,7 +9809,8 @@ static MaybeObject* Runtime_DebugEvaluate(Arguments args) { |
| Handle<SharedFunctionInfo> shared = |
| Compiler::CompileEval(function_source, |
| context, |
| - context->IsGlobalContext()); |
| + context->IsGlobalContext(), |
| + false); // We need to get this from the current function |
|
Lasse Reichstein
2011/02/01 11:26:24
We should check whether the debugger would want th
|
| if (shared.is_null()) return Failure::Exception(); |
| Handle<JSFunction> compiled_function = |
| Factory::NewFunctionFromSharedFunctionInfo(shared, context); |
| @@ -9888,7 +9895,8 @@ static MaybeObject* Runtime_DebugEvaluateGlobal(Arguments args) { |
| Handle<SharedFunctionInfo> shared = |
| Compiler::CompileEval(source, |
| context, |
| - is_global); |
| + is_global, |
| + false); // take from currently executing function |
| if (shared.is_null()) return Failure::Exception(); |
| Handle<JSFunction> compiled_function = |
| Handle<JSFunction>(Factory::NewFunctionFromSharedFunctionInfo(shared, |