Revert of [inspector] align console implementation with spec (patchset #2 id:20001 of https://chromiumcodereview.appspot.com/2428473003/ )
Reason for revert: Breaks roll: https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/164610 See https://chromiumcodereview.appspot.com/2434733002/ for more context Original issue's description: > [inspector] align console implementation with spec > > console should be non enumerable. > > BUG=chromium:656826 > R=dgozman@chromium.org TBR=dgozman@chromium.org,kozyatinskiy@chromium.org NOTRY=true BUG=chromium:656826 Review-Url: https://chromiumcodereview.appspot.com/2435013002 Cr-Commit-Position: refs/heads/master@{#40464}
This commit is contained in:
parent
85cb43cbb8
commit
555a725810
@ -48,11 +48,9 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
|
|||||||
v8::Local<v8::Object> global = info.context->Global();
|
v8::Local<v8::Object> global = info.context->Global();
|
||||||
v8::Local<v8::Object> console =
|
v8::Local<v8::Object> console =
|
||||||
V8Console::createConsole(this, info.hasMemoryOnConsole);
|
V8Console::createConsole(this, info.hasMemoryOnConsole);
|
||||||
v8::PropertyDescriptor descriptor(console, /* writable */ true);
|
if (!global
|
||||||
descriptor.set_enumerable(false);
|
->Set(info.context, toV8StringInternalized(isolate, "console"),
|
||||||
descriptor.set_configurable(true);
|
console)
|
||||||
v8::Local<v8::String> consoleKey = toV8StringInternalized(isolate, "console");
|
|
||||||
if (!global->DefineProperty(info.context, consoleKey, descriptor)
|
|
||||||
.FromMaybe(false))
|
.FromMaybe(false))
|
||||||
return;
|
return;
|
||||||
m_console.Reset(isolate, console);
|
m_console.Reset(isolate, console);
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
Running test: consoleExistsOnGlobal
|
|
||||||
true
|
|
||||||
|
|
||||||
Running test: consoleHasRightPropertyDescriptor
|
|
||||||
{
|
|
||||||
configurable : true
|
|
||||||
enumerable : false
|
|
||||||
value : <value>
|
|
||||||
writable : true
|
|
||||||
}
|
|
||||||
|
|
||||||
Running test: ConsoleNotExistsOnGlobal
|
|
||||||
false
|
|
||||||
|
|
||||||
Running test: prototypeChainMustBeCorrect
|
|
||||||
true
|
|
@ -1,49 +0,0 @@
|
|||||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
InspectorTest.addScript(`
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
function checkPrototype() {
|
|
||||||
const prototype1 = Object.getPrototypeOf(console);
|
|
||||||
const prototype2 = Object.getPrototypeOf(prototype1);
|
|
||||||
if (Object.getOwnPropertyNames(prototype1).length !== 0)
|
|
||||||
return "false: The [[Prototype]] must have no properties";
|
|
||||||
if (prototype2 !== Object.prototype)
|
|
||||||
return "false: The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%";
|
|
||||||
return "true";
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
InspectorTest.runTestSuite([
|
|
||||||
function consoleExistsOnGlobal(next) {
|
|
||||||
Protocol.Runtime.evaluate({ expression: "self.hasOwnProperty(\"console\")", returnByValue: true})
|
|
||||||
.then(message => InspectorTest.log(message.result.result.value))
|
|
||||||
.then(next);
|
|
||||||
},
|
|
||||||
|
|
||||||
function consoleHasRightPropertyDescriptor(next) {
|
|
||||||
Protocol.Runtime.evaluate({ expression: "Object.getOwnPropertyDescriptor(self, \"console\")", returnByValue: true})
|
|
||||||
.then(dumpDescriptor)
|
|
||||||
.then(next);
|
|
||||||
|
|
||||||
function dumpDescriptor(message) {
|
|
||||||
var value = message.result.result.value;
|
|
||||||
value.value = "<value>";
|
|
||||||
InspectorTest.logObject(value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
function ConsoleNotExistsOnGlobal(next) {
|
|
||||||
Protocol.Runtime.evaluate({ expression: "\"Console\" in self", returnByValue: true})
|
|
||||||
.then(message => InspectorTest.log(message.result.result.value))
|
|
||||||
.then(next);
|
|
||||||
},
|
|
||||||
|
|
||||||
function prototypeChainMustBeCorrect(next) {
|
|
||||||
Protocol.Runtime.evaluate({ expression: "checkPrototype()", returnByValue: true })
|
|
||||||
.then(message => InspectorTest.log(message.result.result.value))
|
|
||||||
.then(next);
|
|
||||||
}
|
|
||||||
]);
|
|
Loading…
Reference in New Issue
Block a user