Changeset 288065 in webkit
- Timestamp:
- Jan 15, 2022 1:32:37 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 11 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/wasm/stress/create-tag-from.js (modified) (1 diff)
-
JSTests/wasm/v8/exceptions-api.js (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.worker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/type.tentative.any-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/type.tentative.any.html (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/type.tentative.any.js (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/type.tentative.any.worker-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/type.tentative.any.worker.html (deleted)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/wasm/js/WebAssemblyExceptionPrototype.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r288062 r288065 1 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Fix misc issues in WebAssembly.Exception 4 https://bugs.webkit.org/show_bug.cgi?id=235261 5 6 Reviewed by Alexey Shvayka. 7 8 * wasm/stress/create-tag-from.js: 9 * wasm/v8/exceptions-api.js: 10 (TestGetArg): 11 1 12 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 13 -
trunk/JSTests/wasm/stress/create-tag-from.js
r283852 r288065 18 18 assert.eq(exception.getArg(tag, 2), parameters); 19 19 20 assert.throws(() => exception.getArg(tag, 3), RangeError, "WebAssembly.Exception.getArg(): Index out of range");20 assert.throws(() => exception.getArg(tag, 3), TypeError, "WebAssembly.Exception.getArg(): Index out of range"); 21 21 22 22 assert.eq(WebAssembly.Exception.prototype.__proto__, Object.prototype) -
trunk/JSTests/wasm/v8/exceptions-api.js
r283852 r288065 203 203 //assertThrows(() => exception.getArg(tag, undefined), TypeError, 204 204 ///Index must be convertible to a valid number/); 205 assertThrows(() => exception.getArg(tag, 0xFFFFFFFF), RangeError,205 assertThrows(() => exception.getArg(tag, 0xFFFFFFFF), TypeError, 206 206 /Index out of range/); 207 207 let wrong_tag = new WebAssembly.Tag({parameters: ['i32']}); -
trunk/LayoutTests/imported/w3c/ChangeLog
r288064 r288065 1 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Fix misc issues in WebAssembly.Exception 4 https://bugs.webkit.org/show_bug.cgi?id=235261 5 6 Reviewed by Alexey Shvayka. 7 8 Remove web-platform-tests/wasm/jsapi/exception/type.tentative.any.js test since 9 this behavior is not defined in wasm exception-handling and/or wasm js-types spec. 10 Probably this test was confused with WebAssembly.Tag (and that test is in wasm/jsapi/tag/). 11 12 Also change RangeError to TypeError according to the spec[1]. 13 14 [1]: https://webassembly.github.io/exception-handling/js-api/index.html#dom-exception-getarg 15 16 * web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt: 17 * web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js: 18 (test): 19 * web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt: 20 * web-platform-tests/wasm/jsapi/exception/toString.tentative.any-expected.txt: 21 * web-platform-tests/wasm/jsapi/exception/toString.tentative.any.worker-expected.txt: 22 * web-platform-tests/wasm/jsapi/exception/type.tentative.any-expected.txt: Removed. 23 * web-platform-tests/wasm/jsapi/exception/type.tentative.any.html: Removed. 24 * web-platform-tests/wasm/jsapi/exception/type.tentative.any.js: Removed. 25 * web-platform-tests/wasm/jsapi/exception/type.tentative.any.worker-expected.txt: Removed. 26 * web-platform-tests/wasm/jsapi/exception/type.tentative.any.worker.html: Removed. 27 1 28 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 29 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt
r288049 r288065 1 1 2 FAIL Missing arguments assert_throws_js: function "() => exn.getArg(tag)" threw object "RangeError: WebAssembly.Exception.getArg(): Index out of range" ("RangeError") expected instance of function "function TypeError() { 3 [native code] 4 }" ("TypeError") 2 PASS Missing arguments 5 3 PASS Invalid exception argument 6 4 PASS Index out of bounds 7 FAIL Getting out-of-range argument assert_throws_js: function "() => exn.getArg(tag, value)" threw object "RangeError: WebAssembly.Exception.getArg(): Index out of range" ("RangeError") expected instance of function "function TypeError() { 8 [native code] 9 }" ("TypeError") 5 PASS Getting out-of-range argument 10 6 PASS getArg 11 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js
r288049 r288065 21 21 const tag = new WebAssembly.Tag({ parameters: [] }); 22 22 const exn = new WebAssembly.Exception(tag, []); 23 assert_throws_js( RangeError, () => exn.getArg(tag, 1));23 assert_throws_js(TypeError, () => exn.getArg(tag, 1)); 24 24 }, "Index out of bounds"); 25 25 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt
r288049 r288065 1 1 2 FAIL Missing arguments assert_throws_js: function "() => exn.getArg(tag)" threw object "RangeError: WebAssembly.Exception.getArg(): Index out of range" ("RangeError") expected instance of function "function TypeError() { 3 [native code] 4 }" ("TypeError") 2 PASS Missing arguments 5 3 PASS Invalid exception argument 6 4 PASS Index out of bounds 7 FAIL Getting out-of-range argument assert_throws_js: function "() => exn.getArg(tag, value)" threw object "RangeError: WebAssembly.Exception.getArg(): Index out of range" ("RangeError") expected instance of function "function TypeError() { 8 [native code] 9 }" ("TypeError") 5 PASS Getting out-of-range argument 10 6 PASS getArg 11 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any-expected.txt
r288049 r288065 1 1 2 2 PASS Object.prototype.toString on an Exception 3 FAIL @@toStringTag exists on the prototype with the appropriate descriptor assert_own_property: expected property symbol "Symbol(Symbol.toStringTag)" missing 3 PASS @@toStringTag exists on the prototype with the appropriate descriptor 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.worker-expected.txt
r288049 r288065 1 1 2 2 PASS Object.prototype.toString on an Exception 3 FAIL @@toStringTag exists on the prototype with the appropriate descriptor assert_own_property: expected property symbol "Symbol(Symbol.toStringTag)" missing 3 PASS @@toStringTag exists on the prototype with the appropriate descriptor 4 4 -
trunk/Source/JavaScriptCore/ChangeLog
r288064 r288065 1 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Fix misc issues in WebAssembly.Exception 4 https://bugs.webkit.org/show_bug.cgi?id=235261 5 6 Reviewed by Alexey Shvayka. 7 8 1. Add @toStringTag to WebAssembly.Exception.prototype. 9 2. Add argument count check for WebAssembly.Exception methods (since it is specified in WebIDL and these methods do not have optional parameters). 10 11 * wasm/js/WebAssemblyExceptionPrototype.cpp: 12 (JSC::WebAssemblyExceptionPrototype::finishCreation): 13 (JSC::JSC_DEFINE_HOST_FUNCTION): 14 1 15 2022-01-15 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyExceptionPrototype.cpp
r285730 r288065 48 48 @begin prototypeTableWebAssemblyException 49 49 getArg webAssemblyExceptionProtoFuncGetArg Function 2 50 is webAssemblyExceptionProtoFuncIsFunction 150 is webAssemblyExceptionProtoFuncIs Function 1 51 51 @end 52 52 */ … … 68 68 Base::finishCreation(vm); 69 69 ASSERT(inherits(vm, info())); 70 JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); 70 71 } 71 72 … … 107 108 }; 108 109 const auto& typeError = [&](const auto& message) { 109 throwTypeError(globalObject, throwScope, formatMessage(message)); 110 return encodedJSValue(); 110 return throwVMTypeError(globalObject, throwScope, formatMessage(message)); 111 111 }; 112 112 113 113 JSWebAssemblyException* jsException = getException(globalObject, callFrame->thisValue()); 114 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 114 RETURN_IF_EXCEPTION(throwScope, { }); 115 116 if (UNLIKELY(callFrame->argumentCount() < 2)) 117 return JSValue::encode(throwException(globalObject, throwScope, createNotEnoughArgumentsError(globalObject))); 115 118 116 119 JSWebAssemblyTag* tag = getTag(vm, callFrame->argument(0)); … … 122 125 123 126 uint32_t index = callFrame->argument(1).toUInt32(globalObject); 124 if (index >= tag->tag().parameterCount()) { 125 throwRangeError(globalObject, throwScope, formatMessage("Index out of range")); 126 return encodedJSValue(); 127 } 127 if (index >= tag->tag().parameterCount()) 128 return typeError("Index out of range"); 128 129 129 130 RELEASE_AND_RETURN(throwScope, JSValue::encode(jsException->getArg(globalObject, index))); … … 136 137 137 138 JSWebAssemblyException* jsException = getException(globalObject, callFrame->thisValue()); 138 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 139 RETURN_IF_EXCEPTION(throwScope, { }); 140 141 if (UNLIKELY(callFrame->argumentCount() < 1)) 142 return JSValue::encode(throwException(globalObject, throwScope, createNotEnoughArgumentsError(globalObject))); 139 143 140 144 JSWebAssemblyTag* tag = getTag(vm, callFrame->argument(0)); 141 if (!tag) { 142 throwTypeError(globalObject, throwScope, "WebAssembly.Exception.is(): First argument must be a WebAssembly.Tag"); 143 return encodedJSValue(); 144 } 145 if (!tag) 146 return throwVMTypeError(globalObject, throwScope, "WebAssembly.Exception.is(): First argument must be a WebAssembly.Tag"); 145 147 146 148 RELEASE_AND_RETURN(throwScope, JSValue::encode(jsBoolean(jsException->tag() == tag->tag())));
Note: See TracChangeset
for help on using the changeset viewer.