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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 662a9e126b04b1bad9489ddb468c09666436eff1..ec9657b1d8e3c0cd9036bd66dcac6227342d7d3b 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -787,6 +787,40 @@ Handle<AccessorInfo> Accessors::ScriptSourceMappingUrlInfo(
//
+// Accessors::ScriptIsInternalScript
+//
+
+
+void Accessors::ScriptIsInternalScriptGetter(
+ v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
+ DisallowHeapAllocation no_allocation;
+ HandleScope scope(isolate);
+ Object* object = *Utils::OpenHandle(*info.This());
+ bool is_internal_script =
+ Script::cast(JSValue::cast(object)->value())->is_internal_script();
+ Object* res = *isolate->factory()->ToBoolean(is_internal_script);
+ info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(res, isolate)));
+}
+
+
+void Accessors::ScriptIsInternalScriptSetter(
+ v8::Local<v8::Name> name, v8::Local<v8::Value> value,
+ const v8::PropertyCallbackInfo<void>& info) {
+ UNREACHABLE();
+}
+
+
+Handle<AccessorInfo> Accessors::ScriptIsInternalScriptInfo(
+ Isolate* isolate, PropertyAttributes attributes) {
+ Handle<String> name(isolate->factory()->InternalizeOneByteString(
+ STATIC_CHAR_VECTOR("is_internal_script")));
+ return MakeAccessor(isolate, name, &ScriptIsInternalScriptGetter,
+ &ScriptIsInternalScriptSetter, attributes);
+}
+
+
+//
// Accessors::ScriptGetContextData
//

Powered by Google App Engine
This is Rietveld 408576698