WebKit Bugzilla
Attachment 371390 Details for
Bug 198495
: Date.prototype.toJSON throws if toISOString returns an object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198495-20190605153358.patch (text/plain), 3.68 KB, created by
Alexey Shvayka
on 2019-06-05 05:33:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alexey Shvayka
Created:
2019-06-05 05:33:59 PDT
Size:
3.68 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 246076) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-06-05 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Date.prototype.toJSON throws if toISOString returns an object >+ https://bugs.webkit.org/show_bug.cgi?id=198495 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Don't throw TypeError if result of toISOString call is not a primitive. >+ (step 4 of https://tc39.github.io/ecma262/#sec-date.prototype.tojson) >+ >+ * runtime/DatePrototype.cpp: >+ (JSC::dateProtoFuncToJSON): Remove isObject check. >+ > 2019-06-04 Tadeu Zagallo <tzagallo@apple.com> > > Argument elimination should check transitive dependents for interference >Index: Source/JavaScriptCore/runtime/DatePrototype.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/DatePrototype.cpp (revision 246067) >+++ Source/JavaScriptCore/runtime/DatePrototype.cpp (working copy) >@@ -1163,8 +1163,6 @@ EncodedJSValue JSC_HOST_CALL dateProtoFu > > JSValue result = call(exec, asObject(toISOValue), callType, callData, object, *vm.emptyList); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); >- if (result.isObject()) >- return throwVMTypeError(exec, scope, "toISOString did not return a primitive value"_s); > return JSValue::encode(result); > } > >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 246067) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-06-05 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Date.prototype.toJSON throws if toISOString returns an object >+ https://bugs.webkit.org/show_bug.cgi?id=198495 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ TypeError shouldn't be thrown if result of toISOString call is an object. >+ (step 4 of https://tc39.github.io/ecma262/#sec-date.prototype.tojson) >+ >+ * js/dom/JSON-stringify-expected.txt: >+ * js/resources/JSON-stringify.js: >+ > 2019-06-04 Antoine Quint <graouts@apple.com> > > The "mouseenter" and "pointerenter" events are fired from the bottom up >Index: LayoutTests/js/dom/JSON-stringify-expected.txt >=================================================================== >--- LayoutTests/js/dom/JSON-stringify-expected.txt (revision 246067) >+++ LayoutTests/js/dom/JSON-stringify-expected.txt (working copy) >@@ -91,7 +91,7 @@ PASS tests[i](nativeJSON) is tests[i](JS > function (jsonObject){ > return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }}); > } >-PASS tests[i](nativeJSON) threw exception TypeError: toISOString did not return a primitive value. >+PASS tests[i](nativeJSON) is tests[i].expected > function (jsonObject){ > return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }}); > } >Index: LayoutTests/js/resources/JSON-stringify.js >=================================================================== >--- LayoutTests/js/resources/JSON-stringify.js (revision 246067) >+++ LayoutTests/js/resources/JSON-stringify.js (working copy) >@@ -95,7 +95,7 @@ function createTests() { > result.push(function(jsonObject){ > return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }}); > }); >- result[result.length - 1].throws = true; >+ result[result.length - 1].expected = '{}'; > result.push(function(jsonObject){ > return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }}); > });
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198495
:
371211
|
371218
|
371219
|
371222
|
371223
|
371226
|
371240
|
371255
|
371260
|
371390
|
372363
|
376709