Update object.prototype.toString to conform ES11 standard (#4196)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg
2020-10-07 15:05:17 +02:00
committed by GitHub
parent 17fe441819
commit 99c7099eaa
4 changed files with 31 additions and 10 deletions
@@ -21,7 +21,7 @@ assert (Symbol.prototype[Symbol.toStringTag] === undefined);
Symbol.prototype[Symbol.toStringTag] = "myStringTag1";
assert (Object.prototype.toString.call (Symbol ()) === "[object myStringTag1]");
Symbol.prototype[Symbol.toStringTag] = {};
assert (Object.prototype.toString.call (Symbol ()) === "[object Symbol]");
assert (Object.prototype.toString.call (Symbol ()) === "[object Object]");
/* Math @@toStringTag */
assert (Math[Symbol.toStringTag] === "Math");
@@ -32,7 +32,7 @@ assert (Math[Symbol.toStringTag] === undefined);
Math[Symbol.toStringTag] = "myStringTag2";
assert (Object.prototype.toString.call (Math) === "[object myStringTag2]");
Math[Symbol.toStringTag] = {};
assert (Object.prototype.toString.call (Math) === "[object Math]");
assert (Object.prototype.toString.call (Math) === "[object Object]");
/* ArrayBuffer.prototype @@toStringTag */
assert (ArrayBuffer.prototype[Symbol.toStringTag] === "ArrayBuffer");
@@ -43,7 +43,7 @@ assert (ArrayBuffer.prototype[Symbol.toStringTag] === undefined);
ArrayBuffer.prototype[Symbol.toStringTag] = "myStringTag3";
assert (Object.prototype.toString.call (new ArrayBuffer ()) === "[object myStringTag3]");
ArrayBuffer.prototype[Symbol.toStringTag] = {};
assert (ArrayBuffer.prototype.toString.call (new ArrayBuffer ()) === "[object ArrayBuffer]");
assert (ArrayBuffer.prototype.toString.call (new ArrayBuffer ()) === "[object Object]");
/* Promise.prototype @@toStringTag */
assert (Promise.prototype[Symbol.toStringTag] === "Promise");
@@ -54,7 +54,7 @@ assert (Promise.prototype[Symbol.toStringTag] === undefined);
Promise.prototype[Symbol.toStringTag] = "myStringTag4";
assert (Object.prototype.toString.call (new Promise (function () {})) === "[object myStringTag4]");
Promise.prototype[Symbol.toStringTag] = {};
assert (Promise.prototype.toString.call (new Promise (function () {})) === "[object Promise]");
assert (Promise.prototype.toString.call (new Promise (function () {})) === "[object Object]");
/* Map.prototype @@toStringTag */
assert (Map.prototype[Symbol.toStringTag] === "Map");
@@ -67,7 +67,7 @@ Map.prototype[Symbol.toStringTag] = "myStringTag5";
assert (Map.prototype.toString.call (new Map ()) === "[object myStringTag5]");
assert (Object.prototype.toString.call (Map) === "[object Function]");
Map.prototype[Symbol.toStringTag] = {};
assert (Map.prototype.toString.call (new Map) === "[object Map]");
assert (Map.prototype.toString.call (new Map) === "[object Object]");
/* JSON @@toStringTag */
assert (JSON[Symbol.toStringTag] === "JSON");
@@ -78,7 +78,7 @@ assert (JSON[Symbol.toStringTag] === undefined);
JSON[Symbol.toStringTag] = "myStringTag6";
assert (Map.prototype.toString.call (JSON) === "[object myStringTag6]");
JSON[Symbol.toStringTag] = {};
assert (Object.prototype.toString.call (JSON) === "[object JSON]");
assert (Object.prototype.toString.call (JSON) === "[object Object]");
var typedArrayTypes = ["Int8Array",
"Uint8Array",
-4
View File
@@ -806,9 +806,6 @@
<test id="built-ins/Object/entries/order-after-define-property.js"><reason></reason></test>
<test id="built-ins/Object/keys/order-after-define-property.js"><reason></reason></test>
<test id="built-ins/Object/proto-from-ctor-realm.js"><reason></reason></test>
<test id="built-ins/Object/prototype/toString/proxy-function.js"><reason></reason></test>
<test id="built-ins/Object/prototype/toString/symbol-tag-non-str-bigint.js"><reason></reason></test>
<test id="built-ins/Object/prototype/toString/symbol-tag-non-str-builtin.js"><reason></reason></test>
<test id="built-ins/Object/prototype/toString/symbol-tag-non-str-proxy-function.js"><reason></reason></test>
<test id="built-ins/Object/subclass-object-arg.js"><reason></reason></test>
<test id="built-ins/Promise/all/invoke-resolve-get-error.js"><reason>Test expects incorrect call order</reason></test>
@@ -8926,5 +8923,4 @@
<test id="language/expressions/optional-chaining/short-circuiting.js"><reason></reason></test>
<test id="language/expressions/optional-chaining/super-property-optional-call.js"><reason></reason></test>
<!-- END - ES2020: Optional Chaining -->
</excludeList>