Changeset 219969 in webkit
- Timestamp:
- Jul 26, 2017 4:29:25 PM (7 years ago)
- Location:
- trunk/JSTests
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r219727 r219969 1 2017-07-26 JF Bastien <jfbastien@apple.com> 2 3 WebAssembly: test throwing out of the start function 4 https://bugs.webkit.org/show_bug.cgi?id=165714 5 <rdar://problem/29760251> 6 7 Reviewed by Keith Miller. 8 9 * wasm/assert.js: 10 * wasm/function-tests/trap-from-start.js: Added. 11 (StartTraps): 12 * wasm/function-tests/trap-from-start-async.js: Added. 13 (async.StartTrapsAsync): 14 1 15 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com> 2 16 -
trunk/JSTests/wasm/assert.js
r214547 r219969 136 136 }; 137 137 138 export async function throwsAsync(promise, type, message) { 139 try { 140 await promise; 141 } catch (e) { 142 if (e instanceof type) { 143 if (e.message === message) 144 return e; 145 // Ignore source information at the end of the error message if the 146 // expected message didn't specify that information. Sometimes it 147 // changes, or it's tricky to get just right. 148 const evaluatingIndex = e.message.indexOf(" (evaluating '"); 149 if (evaluatingIndex !== -1) { 150 const cleanMessage = e.message.substring(0, evaluatingIndex); 151 if (cleanMessage === message) 152 return e; 153 } 154 } 155 _fail(`Expected to throw a ${type.name} with message "${message}", got ${e.name} with message "${e.message}"`); 156 } 157 _fail(`Expected to throw a ${type.name} with message "${message}"`); 158 } 159 138 160 const _instanceof = (obj, type, msg) => { 139 161 if (!(obj instanceof type))
Note: See TracChangeset
for help on using the changeset viewer.