Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: src/accessors.cc

Issue 879553002: [V8] Added Script::is_debugger_script flag for embedders (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/accessors.h ('k') | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/contexts.h" 10 #include "src/contexts.h"
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 Isolate* isolate, PropertyAttributes attributes) { 780 Isolate* isolate, PropertyAttributes attributes) {
781 return MakeAccessor(isolate, 781 return MakeAccessor(isolate,
782 isolate->factory()->source_mapping_url_string(), 782 isolate->factory()->source_mapping_url_string(),
783 &ScriptSourceMappingUrlGetter, 783 &ScriptSourceMappingUrlGetter,
784 &ScriptSourceMappingUrlSetter, 784 &ScriptSourceMappingUrlSetter,
785 attributes); 785 attributes);
786 } 786 }
787 787
788 788
789 // 789 //
790 // Accessors::ScriptIsEmbedderDebugScript
791 //
792
793
794 void Accessors::ScriptIsEmbedderDebugScriptGetter(
795 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
796 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
797 DisallowHeapAllocation no_allocation;
798 HandleScope scope(isolate);
799 Object* object = *Utils::OpenHandle(*info.This());
800 bool is_embedder_debug_script =
801 Script::cast(JSValue::cast(object)->value())->is_embedder_debug_script();
802 Object* res = *isolate->factory()->ToBoolean(is_embedder_debug_script);
803 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(res, isolate)));
804 }
805
806
807 void Accessors::ScriptIsEmbedderDebugScriptSetter(
808 v8::Local<v8::Name> name, v8::Local<v8::Value> value,
809 const v8::PropertyCallbackInfo<void>& info) {
810 UNREACHABLE();
811 }
812
813
814 Handle<AccessorInfo> Accessors::ScriptIsEmbedderDebugScriptInfo(
815 Isolate* isolate, PropertyAttributes attributes) {
816 Handle<String> name(isolate->factory()->InternalizeOneByteString(
817 STATIC_CHAR_VECTOR("is_debugger_script")));
818 return MakeAccessor(isolate, name, &ScriptIsEmbedderDebugScriptGetter,
819 &ScriptIsEmbedderDebugScriptSetter, attributes);
820 }
821
822
823 //
790 // Accessors::ScriptGetContextData 824 // Accessors::ScriptGetContextData
791 // 825 //
792 826
793 827
794 void Accessors::ScriptContextDataGetter( 828 void Accessors::ScriptContextDataGetter(
795 v8::Local<v8::Name> name, 829 v8::Local<v8::Name> name,
796 const v8::PropertyCallbackInfo<v8::Value>& info) { 830 const v8::PropertyCallbackInfo<v8::Value>& info) {
797 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 831 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
798 DisallowHeapAllocation no_allocation; 832 DisallowHeapAllocation no_allocation;
799 HandleScope scope(isolate); 833 HandleScope scope(isolate);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 info->set_data(Smi::FromInt(index)); 1528 info->set_data(Smi::FromInt(index));
1495 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1529 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1496 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1530 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1497 info->set_getter(*getter); 1531 info->set_getter(*getter);
1498 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1532 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1499 return info; 1533 return info;
1500 } 1534 }
1501 1535
1502 1536
1503 } } // namespace v8::internal 1537 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698