OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/debug-evaluate.h" | 5 #include "src/debug/debug-evaluate.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 Isolate* isolate, Handle<SharedFunctionInfo> outer_info, | 88 Isolate* isolate, Handle<SharedFunctionInfo> outer_info, |
89 Handle<Context> context, Handle<HeapObject> context_extension, | 89 Handle<Context> context, Handle<HeapObject> context_extension, |
90 Handle<Object> receiver, Handle<String> source) { | 90 Handle<Object> receiver, Handle<String> source) { |
91 if (context_extension->IsJSObject()) { | 91 if (context_extension->IsJSObject()) { |
92 Handle<JSObject> extension = Handle<JSObject>::cast(context_extension); | 92 Handle<JSObject> extension = Handle<JSObject>::cast(context_extension); |
93 Handle<JSFunction> closure(context->closure(), isolate); | 93 Handle<JSFunction> closure(context->closure(), isolate); |
94 context = isolate->factory()->NewWithContext(closure, context, extension); | 94 context = isolate->factory()->NewWithContext(closure, context, extension); |
95 } | 95 } |
96 | 96 |
97 Handle<JSFunction> eval_fun; | 97 Handle<JSFunction> eval_fun; |
98 ASSIGN_RETURN_ON_EXCEPTION(isolate, eval_fun, | 98 ASSIGN_RETURN_ON_EXCEPTION( |
99 Compiler::GetFunctionFromEval( | 99 isolate, eval_fun, |
100 source, outer_info, context, SLOPPY, | 100 Compiler::GetFunctionFromEval( |
101 NO_PARSE_RESTRICTION, RelocInfo::kNoPosition), | 101 source, outer_info, context, SLOPPY, NO_PARSE_RESTRICTION, |
102 Object); | 102 RelocInfo::kNoPosition, RelocInfo::kNoPosition), |
| 103 Object); |
103 | 104 |
104 Handle<Object> result; | 105 Handle<Object> result; |
105 ASSIGN_RETURN_ON_EXCEPTION( | 106 ASSIGN_RETURN_ON_EXCEPTION( |
106 isolate, result, Execution::Call(isolate, eval_fun, receiver, 0, NULL), | 107 isolate, result, Execution::Call(isolate, eval_fun, receiver, 0, NULL), |
107 Object); | 108 Object); |
108 | 109 |
109 // Skip the global proxy as it has no properties and always delegates to the | 110 // Skip the global proxy as it has no properties and always delegates to the |
110 // real global object. | 111 // real global object. |
111 if (result->IsJSGlobalProxy()) { | 112 if (result->IsJSGlobalProxy()) { |
112 PrototypeIterator iter(isolate, Handle<JSGlobalProxy>::cast(result)); | 113 PrototypeIterator iter(isolate, Handle<JSGlobalProxy>::cast(result)); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // referenced by the current function, so it can be correctly resolved. | 249 // referenced by the current function, so it can be correctly resolved. |
249 return; | 250 return; |
250 } else if (local_function->shared()->scope_info()->HasReceiver()) { | 251 } else if (local_function->shared()->scope_info()->HasReceiver()) { |
251 recv = handle(frame_->receiver(), isolate_); | 252 recv = handle(frame_->receiver(), isolate_); |
252 } | 253 } |
253 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check(); | 254 JSObject::SetOwnPropertyIgnoreAttributes(target, name, recv, NONE).Check(); |
254 } | 255 } |
255 | 256 |
256 } // namespace internal | 257 } // namespace internal |
257 } // namespace v8 | 258 } // namespace v8 |
OLD | NEW |