| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 | 512 |
| 513 Handle<AccessorInfo> Accessors::ScriptSourceMappingUrlInfo( | 513 Handle<AccessorInfo> Accessors::ScriptSourceMappingUrlInfo( |
| 514 Isolate* isolate, PropertyAttributes attributes) { | 514 Isolate* isolate, PropertyAttributes attributes) { |
| 515 return MakeAccessor(isolate, isolate->factory()->source_mapping_url_string(), | 515 return MakeAccessor(isolate, isolate->factory()->source_mapping_url_string(), |
| 516 &ScriptSourceMappingUrlGetter, nullptr, attributes); | 516 &ScriptSourceMappingUrlGetter, nullptr, attributes); |
| 517 } | 517 } |
| 518 | 518 |
| 519 | 519 |
| 520 // | 520 // |
| 521 // Accessors::ScriptIsEmbedderDebugScript | |
| 522 // | |
| 523 | |
| 524 | |
| 525 void Accessors::ScriptIsEmbedderDebugScriptGetter( | |
| 526 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { | |
| 527 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | |
| 528 DisallowHeapAllocation no_allocation; | |
| 529 HandleScope scope(isolate); | |
| 530 Object* script_obj = *Utils::OpenHandle(*info.Holder()); | |
| 531 Script* script = Script::cast(script_obj); | |
| 532 Script::Type type = static_cast<Script::Type>(script->type()); | |
| 533 Object* res = *isolate->factory()->ToBoolean(type == Script::TYPE_INSPECTOR); | |
| 534 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(res, isolate))); | |
| 535 } | |
| 536 | |
| 537 | |
| 538 Handle<AccessorInfo> Accessors::ScriptIsEmbedderDebugScriptInfo( | |
| 539 Isolate* isolate, PropertyAttributes attributes) { | |
| 540 Handle<String> name(isolate->factory()->InternalizeOneByteString( | |
| 541 STATIC_CHAR_VECTOR("is_debugger_script"))); | |
| 542 return MakeAccessor(isolate, name, &ScriptIsEmbedderDebugScriptGetter, | |
| 543 nullptr, attributes); | |
| 544 } | |
| 545 | |
| 546 | |
| 547 // | |
| 548 // Accessors::ScriptGetContextData | 521 // Accessors::ScriptGetContextData |
| 549 // | 522 // |
| 550 | 523 |
| 551 | 524 |
| 552 void Accessors::ScriptContextDataGetter( | 525 void Accessors::ScriptContextDataGetter( |
| 553 v8::Local<v8::Name> name, | 526 v8::Local<v8::Name> name, |
| 554 const v8::PropertyCallbackInfo<v8::Value>& info) { | 527 const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 555 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 528 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
| 556 DisallowHeapAllocation no_allocation; | 529 DisallowHeapAllocation no_allocation; |
| 557 HandleScope scope(isolate); | 530 HandleScope scope(isolate); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, | 1224 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, |
| 1252 PropertyAttributes attributes) { | 1225 PropertyAttributes attributes) { |
| 1253 Handle<AccessorInfo> info = | 1226 Handle<AccessorInfo> info = |
| 1254 MakeAccessor(isolate, isolate->factory()->stack_string(), | 1227 MakeAccessor(isolate, isolate->factory()->stack_string(), |
| 1255 &ErrorStackGetter, &ErrorStackSetter, attributes); | 1228 &ErrorStackGetter, &ErrorStackSetter, attributes); |
| 1256 return info; | 1229 return info; |
| 1257 } | 1230 } |
| 1258 | 1231 |
| 1259 } // namespace internal | 1232 } // namespace internal |
| 1260 } // namespace v8 | 1233 } // namespace v8 |
| OLD | NEW |