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

Unified Diff: src/api.cc

Issue 2772093002: [inspector] exposed builtins for injected script source (Closed)
Patch Set: removed unused variable Created 3 years, 9 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
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index bbce89c0f4a8aeb108db7bf6fc1748f6074f81db..47a2a25211b38051d5f37aedf651a0b0ef188024 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9568,6 +9568,36 @@ v8::MaybeLocal<v8::Array> debug::EntriesPreview(Isolate* v8_isolate,
return v8::MaybeLocal<v8::Array>();
}
+Local<Function> debug::GetBuiltin(Isolate* v8_isolate, Builtin builtin) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ ENTER_V8(isolate);
+ i::HandleScope handle_scope(isolate);
+ i::Builtins::Name name;
+ switch (builtin) {
+ case kObjectKeys:
+ name = i::Builtins::kObjectKeys;
+ break;
+ case kObjectGetPrototypeOf:
+ name = i::Builtins::kObjectGetPrototypeOf;
+ break;
+ case kObjectGetOwnPropertyDescriptor:
+ name = i::Builtins::kObjectGetOwnPropertyDescriptor;
+ break;
+ case kObjectGetOwnPropertyNames:
+ name = i::Builtins::kObjectGetOwnPropertyNames;
+ break;
+ case kObjectGetOwnPropertySymbols:
+ name = i::Builtins::kObjectGetOwnPropertySymbols;
+ break;
+ }
+ i::Handle<i::Code> call_code(isolate->builtins()->builtin(name));
+ i::Handle<i::JSFunction> fun =
+ isolate->factory()->NewFunctionWithoutPrototype(
+ isolate->factory()->empty_string(), call_code, false);
+ fun->shared()->DontAdaptArguments();
+ return Utils::ToLocal(handle_scope.CloseAndEscape(fun));
+}
+
MaybeLocal<debug::Script> debug::GeneratorObject::Script() {
i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
i::Object* maybe_script = obj->function()->shared()->script();
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698