OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // | 520 // |
521 // Accessors::ScriptIsEmbedderDebugScript | 521 // Accessors::ScriptIsEmbedderDebugScript |
522 // | 522 // |
523 | 523 |
524 | 524 |
525 void Accessors::ScriptIsEmbedderDebugScriptGetter( | 525 void Accessors::ScriptIsEmbedderDebugScriptGetter( |
526 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { | 526 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { |
527 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 527 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
528 DisallowHeapAllocation no_allocation; | 528 DisallowHeapAllocation no_allocation; |
529 HandleScope scope(isolate); | 529 HandleScope scope(isolate); |
530 Object* object = *Utils::OpenHandle(*info.Holder()); | 530 Object* script_obj = *Utils::OpenHandle(*info.Holder()); |
531 bool is_embedder_debug_script = Script::cast(JSValue::cast(object)->value()) | 531 Script* script = Script::cast(script_obj); |
532 ->origin_options() | 532 Script::Type type = static_cast<Script::Type>(script->type()); |
533 .IsEmbedderDebugScript(); | 533 Object* res = *isolate->factory()->ToBoolean(type == Script::TYPE_INSPECTOR); |
534 Object* res = *isolate->factory()->ToBoolean(is_embedder_debug_script); | |
535 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(res, isolate))); | 534 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(res, isolate))); |
536 } | 535 } |
537 | 536 |
538 | 537 |
539 Handle<AccessorInfo> Accessors::ScriptIsEmbedderDebugScriptInfo( | 538 Handle<AccessorInfo> Accessors::ScriptIsEmbedderDebugScriptInfo( |
540 Isolate* isolate, PropertyAttributes attributes) { | 539 Isolate* isolate, PropertyAttributes attributes) { |
541 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 540 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
542 STATIC_CHAR_VECTOR("is_debugger_script"))); | 541 STATIC_CHAR_VECTOR("is_debugger_script"))); |
543 return MakeAccessor(isolate, name, &ScriptIsEmbedderDebugScriptGetter, | 542 return MakeAccessor(isolate, name, &ScriptIsEmbedderDebugScriptGetter, |
544 nullptr, attributes); | 543 nullptr, attributes); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, | 1250 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, |
1252 PropertyAttributes attributes) { | 1251 PropertyAttributes attributes) { |
1253 Handle<AccessorInfo> info = | 1252 Handle<AccessorInfo> info = |
1254 MakeAccessor(isolate, isolate->factory()->stack_string(), | 1253 MakeAccessor(isolate, isolate->factory()->stack_string(), |
1255 &ErrorStackGetter, &ErrorStackSetter, attributes); | 1254 &ErrorStackGetter, &ErrorStackSetter, attributes); |
1256 return info; | 1255 return info; |
1257 } | 1256 } |
1258 | 1257 |
1259 } // namespace internal | 1258 } // namespace internal |
1260 } // namespace v8 | 1259 } // namespace v8 |
OLD | NEW |