11cb0ef41Sopenharmony_ci"use strict"; 21cb0ef41Sopenharmony_ci// https://webidl.spec.whatwg.org/#es-namespaces 31cb0ef41Sopenharmony_ci// https://console.spec.whatwg.org/#console-namespace 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_citest(() => { 61cb0ef41Sopenharmony_ci assert_own_property(console, Symbol.toStringTag); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci const propDesc = Object.getOwnPropertyDescriptor(console, Symbol.toStringTag); 91cb0ef41Sopenharmony_ci assert_equals(propDesc.value, "console", "value"); 101cb0ef41Sopenharmony_ci assert_equals(propDesc.writable, false, "writable"); 111cb0ef41Sopenharmony_ci assert_equals(propDesc.enumerable, false, "enumerable"); 121cb0ef41Sopenharmony_ci assert_equals(propDesc.configurable, true, "configurable"); 131cb0ef41Sopenharmony_ci}, "@@toStringTag exists on the namespace object with the appropriate descriptor"); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_citest(() => { 161cb0ef41Sopenharmony_ci assert_equals(console.toString(), "[object console]"); 171cb0ef41Sopenharmony_ci assert_equals(Object.prototype.toString.call(console), "[object console]"); 181cb0ef41Sopenharmony_ci}, "Object.prototype.toString applied to the namespace object"); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_citest(t => { 211cb0ef41Sopenharmony_ci assert_own_property(console, Symbol.toStringTag, "Precondition: @@toStringTag on the namespace object"); 221cb0ef41Sopenharmony_ci t.add_cleanup(() => { 231cb0ef41Sopenharmony_ci Object.defineProperty(console, Symbol.toStringTag, { value: "console" }); 241cb0ef41Sopenharmony_ci }); 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci Object.defineProperty(console, Symbol.toStringTag, { value: "Test" }); 271cb0ef41Sopenharmony_ci assert_equals(console.toString(), "[object Test]"); 281cb0ef41Sopenharmony_ci assert_equals(Object.prototype.toString.call(console), "[object Test]"); 291cb0ef41Sopenharmony_ci}, "Object.prototype.toString applied after modifying the namespace object's @@toStringTag"); 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_citest(t => { 321cb0ef41Sopenharmony_ci assert_own_property(console, Symbol.toStringTag, "Precondition: @@toStringTag on the namespace object"); 331cb0ef41Sopenharmony_ci t.add_cleanup(() => { 341cb0ef41Sopenharmony_ci Object.defineProperty(console, Symbol.toStringTag, { value: "console" }); 351cb0ef41Sopenharmony_ci }); 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci assert_true(delete console[Symbol.toStringTag]); 381cb0ef41Sopenharmony_ci assert_equals(console.toString(), "[object Object]"); 391cb0ef41Sopenharmony_ci assert_equals(Object.prototype.toString.call(console), "[object Object]"); 401cb0ef41Sopenharmony_ci}, "Object.prototype.toString applied after deleting @@toStringTag"); 41