mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 23:59:59 -05:00
tests(wpt/console): Enables web platform tests for console (#9013)
This commit is contained in:
parent
f7e09c6a55
commit
9801858cb0
4 changed files with 21 additions and 2 deletions
|
@ -313,7 +313,7 @@ unitTest(function consoleTestStringifyCircular(): void {
|
|||
);
|
||||
assertEquals(
|
||||
stringify(console),
|
||||
`{
|
||||
`console {
|
||||
log: [Function: log],
|
||||
debug: [Function: log],
|
||||
info: [Function: log],
|
||||
|
@ -334,6 +334,7 @@ unitTest(function consoleTestStringifyCircular(): void {
|
|||
clear: [Function: clear],
|
||||
trace: [Function: trace],
|
||||
indentLevel: 0,
|
||||
[Symbol(Symbol.toStringTag)]: "console",
|
||||
[Symbol(isConsoleInstance)]: true
|
||||
}`,
|
||||
);
|
||||
|
|
|
@ -174,6 +174,12 @@
|
|||
"structured-serialize-detail",
|
||||
"user_timing_exists"
|
||||
],
|
||||
"console": [
|
||||
"console-is-a-namespace",
|
||||
"console-label-conversion",
|
||||
"console-namespace-object-class-string",
|
||||
"console-tests-historical",
|
||||
],
|
||||
"WebCryptoApi": [
|
||||
"getRandomValues"
|
||||
]
|
||||
|
|
|
@ -1449,7 +1449,14 @@
|
|||
// For historical web-compatibility reasons, the namespace object for
|
||||
// console must have as its [[Prototype]] an empty object, created as if
|
||||
// by ObjectCreate(%ObjectPrototype%), instead of %ObjectPrototype%.
|
||||
const console = Object.create({});
|
||||
const console = Object.create({}, {
|
||||
[Symbol.toStringTag]: {
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
value: "console",
|
||||
},
|
||||
});
|
||||
Object.assign(console, this);
|
||||
return console;
|
||||
}
|
||||
|
|
|
@ -245,6 +245,11 @@ delete Object.prototype.__proto__;
|
|||
setTimeout: util.writable(timers.setTimeout),
|
||||
};
|
||||
|
||||
// The console seems to be the only one that should be writable and non-enumerable
|
||||
// thus we don't have a unique helper for it. If other properties follow the same
|
||||
// structure, it might be worth it to define a helper in `util`
|
||||
windowOrWorkerGlobalScope.console.enumerable = false;
|
||||
|
||||
const mainRuntimeGlobalProperties = {
|
||||
Window: globalInterfaces.windowConstructorDescriptor,
|
||||
window: util.readOnly(globalThis),
|
||||
|
|
Loading…
Reference in a new issue