Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit e96a1d1

Browse files
authored
Remove odd tests (#503)
* Remove odd tests These two tests don't make much sense to me because the string argument invokes the `length` constructor of `TypedArray`: https://tc39.github.io/ecma262/#sec-typedarray-length This then goes ToIndex / ToInteger etc, and the string becomes an integer. What's the point of this test? * Remove more of the same * Keep useless input * Hoist the const
1 parent 93bf10b commit e96a1d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/js-api/jsapi.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
const kC0DEFEFE = new Uint8Array([0xC0, 0xDE, 0xFE, 0xFE]);
18+
1719
(function testJSAPI() {
1820

1921
const WasmPage = 64 * 1024;
@@ -686,8 +688,7 @@ assertCompileError([1], TypeError);
686688
assertCompileError([{}], TypeError);
687689
assertCompileError([new Uint8Array()], CompileError);
688690
assertCompileError([new ArrayBuffer()], CompileError);
689-
assertCompileError([new Uint8Array("hi!")], CompileError);
690-
assertCompileError([new ArrayBuffer("hi!")], CompileError);
691+
assertCompileError([kC0DEFEFE], CompileError);
691692

692693
num_tests = 1;
693694
function assertCompileSuccess(bytes) {
@@ -735,8 +736,7 @@ test(() => {
735736
assertInstantiateError([{}], TypeError);
736737
assertInstantiateError([new Uint8Array()], CompileError);
737738
assertInstantiateError([new ArrayBuffer()], CompileError);
738-
assertInstantiateError([new Uint8Array("hi!")], CompileError);
739-
assertInstantiateError([new ArrayBuffer("hi!")], CompileError);
739+
assertInstantiateError([kC0DEFEFE], CompileError);
740740
assertInstantiateError([importingModule], TypeError);
741741
assertInstantiateError([importingModule, null], TypeError);
742742
assertInstantiateError([importingModuleBinary, null], TypeError);

0 commit comments

Comments
 (0)