Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index d7c01afb2cd603f6992067cbf20ab950c35bc598..0d885e14a5914caf01e6bc34bc3799234f910196 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -9287,6 +9287,11 @@ bool debug::Script::WasCompiled() const { |
i::Script::COMPILATION_STATE_COMPILED; |
} |
+bool debug::Script::IsEmbedded() const { |
+ i::Handle<i::Script> script = Utils::OpenHandle(this); |
+ return script->context_data() == script->GetHeap()->uninitialized_symbol(); |
+} |
+ |
int debug::Script::Id() const { return Utils::OpenHandle(this)->id(); } |
int debug::Script::LineOffset() const { |
@@ -9343,12 +9348,13 @@ MaybeLocal<String> debug::Script::SourceMappingURL() const { |
handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); |
} |
-MaybeLocal<Value> debug::Script::ContextData() const { |
+Maybe<int> debug::Script::ContextId() const { |
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
i::HandleScope handle_scope(isolate); |
i::Handle<i::Script> script = Utils::OpenHandle(this); |
- i::Handle<i::Object> value(script->context_data(), isolate); |
- return Utils::ToLocal(handle_scope.CloseAndEscape(value)); |
+ i::Object* value = script->context_data(); |
+ if (value->IsSmi()) return Just(i::Smi::cast(value)->value()); |
+ return Nothing<int>(); |
} |
MaybeLocal<String> debug::Script::Source() const { |