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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 Handle<JSObject> target, Handle<JSFunction> function) { | 295 Handle<JSObject> target, Handle<JSFunction> function) { |
296 // Do not materialize the arguments object for eval or top-level code. | 296 // Do not materialize the arguments object for eval or top-level code. |
297 // Skip if "arguments" is already taken. | 297 // Skip if "arguments" is already taken. |
298 if (!function->shared()->is_function()) return; | 298 if (!function->shared()->is_function()) return; |
299 Maybe<bool> maybe = JSReceiver::HasOwnProperty( | 299 Maybe<bool> maybe = JSReceiver::HasOwnProperty( |
300 target, isolate_->factory()->arguments_string()); | 300 target, isolate_->factory()->arguments_string()); |
301 DCHECK(maybe.IsJust()); | 301 DCHECK(maybe.IsJust()); |
302 if (maybe.FromJust()) return; | 302 if (maybe.FromJust()) return; |
303 | 303 |
304 // FunctionGetArguments can't throw an exception. | 304 // FunctionGetArguments can't throw an exception. |
305 Handle<JSObject> arguments = | 305 Handle<JSObject> arguments = Accessors::FunctionGetArguments(function); |
306 Handle<JSObject>::cast(Accessors::FunctionGetArguments(function)); | |
307 Handle<String> arguments_str = isolate_->factory()->arguments_string(); | 306 Handle<String> arguments_str = isolate_->factory()->arguments_string(); |
308 JSObject::SetOwnPropertyIgnoreAttributes(target, arguments_str, arguments, | 307 JSObject::SetOwnPropertyIgnoreAttributes(target, arguments_str, arguments, |
309 NONE) | 308 NONE) |
310 .Check(); | 309 .Check(); |
311 } | 310 } |
312 | 311 |
313 | 312 |
314 MaybeHandle<Object> DebugEvaluate::ContextBuilder::LoadFromContext( | 313 MaybeHandle<Object> DebugEvaluate::ContextBuilder::LoadFromContext( |
315 Handle<Context> context, Handle<String> name, bool* global) { | 314 Handle<Context> context, Handle<String> name, bool* global) { |
316 static const ContextLookupFlags flags = FOLLOW_CONTEXT_CHAIN; | 315 static const ContextLookupFlags flags = FOLLOW_CONTEXT_CHAIN; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 LoadFromContext(lookup_context, this_string, &global).ToHandle(&receiver); | 397 LoadFromContext(lookup_context, this_string, &global).ToHandle(&receiver); |
399 } else if (local_function->shared()->scope_info()->HasReceiver()) { | 398 } else if (local_function->shared()->scope_info()->HasReceiver()) { |
400 receiver = handle(frame_->receiver(), isolate_); | 399 receiver = handle(frame_->receiver(), isolate_); |
401 } | 400 } |
402 return isolate_->factory()->NewCatchContext(global_function, parent_context, | 401 return isolate_->factory()->NewCatchContext(global_function, parent_context, |
403 this_string, receiver); | 402 this_string, receiver); |
404 } | 403 } |
405 | 404 |
406 } // namespace internal | 405 } // namespace internal |
407 } // namespace v8 | 406 } // namespace v8 |
OLD | NEW |