Skip to content

Commit ca328fc

Browse files
authored
Changed u32/u64 to i32/i64 (#41)
1 parent 7cfa894 commit ca328fc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

document/js-api/index.bs

+3-3
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ interface Instance {
608608

609609
<pre class="idl">
610610
enum MemoryIndexType {
611-
"u32",
612-
"u64",
611+
"i32",
612+
"i64",
613613
};
614614

615615
dictionary MemoryDescriptor {
@@ -668,7 +668,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
668668
1. Let |initial| be |descriptor|["initial"].
669669
1. If |descriptor|["maximum"] [=map/exists=], let |maximum| be |descriptor|["maximum"]; otherwise, let |maximum| be empty.
670670
1. If |maximum| is not empty and |maximum| &lt; |initial|, throw a {{RangeError}} exception.
671-
1. If |descriptior|["index"] [=map/exists=], let |index| be |descriptor|["index"]; otherwise, let |index| be "u32".
671+
1. If |descriptior|["index"] [=map/exists=], let |index| be |descriptor|["index"]; otherwise, let |index| be "i32".
672672
1. Let |memtype| be { min |initial|, max |maximum|, index |index| }.
673673
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
674674
1. Let (|store|, |memaddr|) be [=mem_alloc=](|store|, |memtype|). If allocation fails, throw a {{RangeError}} exception.

test/js-api/memory/constructor.any.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test(() => {
7373
},
7474
get(o, x) {
7575
if (x === "index") {
76-
return "u32";
76+
return "i32";
7777
}
7878
return 0;
7979
},
@@ -135,20 +135,20 @@ test(() => {
135135
test(() => {
136136
const argument = { "initial": 1 };
137137
const memory = new WebAssembly.Memory(argument);
138-
assert_Memory(memory, { "size": 1, "index": "u32" });
138+
assert_Memory(memory, { "size": 1, "index": "i32" });
139139
}, "Memory with index parameter omitted");
140140

141141
test(() => {
142-
const argument = { "initial": 1, "index": "u32" };
142+
const argument = { "initial": 1, "index": "i32" };
143143
const memory = new WebAssembly.Memory(argument);
144-
assert_Memory(memory, { "size": 1, "index": "u32" });
145-
}, "Memory with u32 index constructor");
144+
assert_Memory(memory, { "size": 1, "index": "i32" });
145+
}, "Memory with i32 index constructor");
146146

147147
test(() => {
148-
const argument = { "initial": 1, "index": "u64" };
148+
const argument = { "initial": 1, "index": "i64" };
149149
const memory = new WebAssembly.Memory(argument);
150-
assert_Memory(memory, { "size": 1, "index": "u64" });
151-
}, "Memory with u64 index constructor");
150+
assert_Memory(memory, { "size": 1, "index": "i64" });
151+
}, "Memory with i64 index constructor");
152152

153153
test(() => {
154154
assert_throws_js(TypeError, () => new WebAssembly.Memory({ "initial": 1, "index": "none" }));

0 commit comments

Comments
 (0)