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

Unified Diff: test/inspector/inspector-test.cc

Issue 2705533002: [inspector] remove iterators and for...of loops from injected-script-source (Closed)
Patch Set: ac Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/runtime/evaluate-with-generate-preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-test.cc
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
index d2d44402d76cdca0272d663ab9a5dbf123522aa1..0c99c5d50c4da34889dc560cafaf986ee7e62aca 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -382,7 +382,8 @@ class InspectorExtension : public v8::Extension {
"native function setMaxAsyncTaskStacks();"
"native function breakProgram();"
"native function createObjectWithStrictCheck();"
- "native function callWithScheduledBreak();") {}
+ "native function callWithScheduledBreak();"
+ "native function allowAccessorFormatting();") {}
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) {
@@ -427,6 +428,13 @@ class InspectorExtension : public v8::Extension {
.FromJust()) {
return v8::FunctionTemplate::New(
isolate, InspectorExtension::CallWithScheduledBreak);
+ } else if (name->Equals(context, v8::String::NewFromUtf8(
+ isolate, "allowAccessorFormatting",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked())
+ .FromJust()) {
+ return v8::FunctionTemplate::New(
+ isolate, InspectorExtension::AllowAccessorFormatting);
}
return v8::Local<v8::FunctionTemplate>();
}
@@ -525,6 +533,24 @@ class InspectorExtension : public v8::Extension {
nullptr);
session->cancelPauseOnNextStatement();
}
+
+ static void AllowAccessorFormatting(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ if (args.Length() != 1 || !args[0]->IsObject()) {
+ fprintf(stderr, "Internal error: allowAccessorFormatting('object').");
+ Exit();
+ }
+ v8::Local<v8::Object> object = args[0].As<v8::Object>();
+ v8::Isolate* isolate = args.GetIsolate();
+ v8::Local<v8::Private> shouldFormatAccessorsPrivate = v8::Private::ForApi(
+ isolate, v8::String::NewFromUtf8(isolate, "allowAccessorFormatting",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked());
+ object
+ ->SetPrivate(isolate->GetCurrentContext(), shouldFormatAccessorsPrivate,
+ v8::Null(isolate))
+ .ToChecked();
+ }
};
v8::Local<v8::String> ToString(v8::Isolate* isolate,
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/runtime/evaluate-with-generate-preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698