From 39b7487af63913c76eacea9d5b6418ae197b5595 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 18 Jul 2024 11:36:27 +0200 Subject: [PATCH 1/2] [js-api] Editorial: fix some bikeshed warnings Fixes #1767. --- document/js-api/index.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index de3419cff6..0b9ffd53c5 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -741,7 +741,8 @@ Immediately after a WebAssembly [=memory.grow=] instruction executes, perform th {{ArrayBuffer}} objects returned by a {{Memory}} object must have a size that is a multiple of a WebAssembly [=page size=] (the constant 65536). For this reason [=HostResizeArrayBuffer=] is redefined as follows.
- The abstract operation [=HostResizeArrayBuffer=] takes arguments |buffer| (an {{ArrayBuffer}}) and |newLength|. It performs the following steps when called. + + The abstract operation [=HostResizeArrayBuffer=] takes arguments |buffer| (an {{ArrayBuffer}}) and |newLength|. It performs the following steps when called. 1. If |buffer|.\[[ArrayBufferDetachKey]] is "WebAssembly.Memory", 1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=]. @@ -1089,7 +1090,7 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not 1. If |resultsSize| is 0, return « ». 1. Otherwise, if |resultsSize| is 1, return « [=?=] [=ToWebAssemblyValue=](|ret|, |results|[0]) ». 1. Otherwise, - 1. Let |method| be [=?=] [$GetMethod$](|ret|, {{@@iterator}}). + 1. Let |method| be [=?=] [$GetMethod$](|ret|, {{%Symbol.iterator%}}). 1. If |method| is undefined, [=throw=] a {{TypeError}}. 1. Let |values| be [=?=] [$IteratorToList$]([=?=] [$GetIteratorFromMethod$](|ret|, |method|)). 1. Let |wasmValues| be a new, empty [=list=]. @@ -1210,7 +1211,7 @@ When the [=namespace object=] for the {{WebAssembly}} namespace is [=create a na 1. Let |namespaceObject| be the [=namespace object=]. 1. [=list/iterate|For each=] |error| of « "CompileError", "LinkError", "RuntimeError" », 1. Let |constructor| be a new object, implementing the [=NativeError Object Structure=], with NativeError set to |error|. - 1. [=!=] [$CreateMethodProperty$](|namespaceObject|, |error|, |constructor|). + 1. [=!=] [$DefineMethodProperty$](|namespaceObject|, |error|, |constructor|, false).
From 1291af309889a5900cdad9c38526e457cb77eac3 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Thu, 18 Jul 2024 18:41:05 +0200 Subject: [PATCH 2/2] [tests/proposals] Fix typos (#1769) --- document/util/htmldiff.pl | 2 +- proposals/bulk-memory-operations/Overview.md | 4 ++-- proposals/multi-value/Overview.md | 4 ++-- proposals/reference-types/Overview.md | 4 ++-- proposals/simd/SIMD.md | 8 ++++---- test/core/float_exprs.wast | 2 +- test/core/simd/simd_load.wast | 6 +++--- test/core/simd/simd_store.wast | 2 +- test/core/utf8-custom-section-id.wast | 2 +- test/core/utf8-import-field.wast | 2 +- test/core/utf8-import-module.wast | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/document/util/htmldiff.pl b/document/util/htmldiff.pl index 4c2780c83f..31ecafef8d 100755 --- a/document/util/htmldiff.pl +++ b/document/util/htmldiff.pl @@ -48,7 +48,7 @@ # also requires the perl modules Getopt::Std # # NOTE: The markup created by htmldiff may not validate against the HTML 4.0 -# DTD. This is because the algorithm is realtively simple, and there are +# DTD. This is because the algorithm is relatively simple, and there are # places in the markup content model where the span element is not allowed. # Htmldiff is NOT aware of these places. # diff --git a/proposals/bulk-memory-operations/Overview.md b/proposals/bulk-memory-operations/Overview.md index 0dfc532642..c93eaa3a0d 100644 --- a/proposals/bulk-memory-operations/Overview.md +++ b/proposals/bulk-memory-operations/Overview.md @@ -228,7 +228,7 @@ The meaning of the bits of the flag field (a `varuint32`) for element segments i | 0 | 0=is active, 1=is passive | | 1 | if bit 0 clear: 0=table 0, 1=has table index | | | if bit 0 set: 0=active, 1=declared | -| 2 | 0=carries indicies; 1=carries elemexprs | +| 2 | 0=carries indices; 1=carries elemexprs | which yields this view, with the fields carried by each flag value: @@ -356,7 +356,7 @@ The bounds check is performed before any data are written. ### `table.init`, `elem.drop`, and `table.copy` instructions -The `table.*` instructions behave similary to the `memory.*` instructions, with +The `table.*` instructions behave similarly to the `memory.*` instructions, with the difference that they operate on element segments and tables, instead of data segments and memories. The offset and length operands of `table.init` and `table.copy` have element units instead of bytes as well. diff --git a/proposals/multi-value/Overview.md b/proposals/multi-value/Overview.md index 42952f0e40..c32af77101 100644 --- a/proposals/multi-value/Overview.md +++ b/proposals/multi-value/Overview.md @@ -9,7 +9,7 @@ - instructions: `value* -> value?` - blocks: `[] -> value?` -* In a stack machine, these asymmetries are artifical restrictions +* In a stack machine, these asymmetries are artificial restrictions - were imposed to simplify the initial WebAssembly release (multiple results deferred to post-MVP) - can easily be lifted by generalising to value* -> value* @@ -32,7 +32,7 @@ - loop labels can have arguments - can represent phis on backward edges - enable future `pick` operator to cross block boundary - - macro definability of instructons with inputs + - macro definability of instructions with inputs * `i32.select3` = `dup if ... else ... end` diff --git a/proposals/reference-types/Overview.md b/proposals/reference-types/Overview.md index 670658f2b7..5a183b64eb 100644 --- a/proposals/reference-types/Overview.md +++ b/proposals/reference-types/Overview.md @@ -95,8 +95,8 @@ New/extended instructions: * The new instruction `table.fill` fills a range in a table with a value. - `table.fill $x : [i32 t i32] -> []` - iff `$x : table t` - - the first operand is the start index of the range, the third operand its length (analoguous to `memory.fill`) - - traps when range+length > size of the table, but only after filling range up to size (analoguous to `memory.fill`) + - the first operand is the start index of the range, the third operand its length (analogous to `memory.fill`) + - traps when range+length > size of the table, but only after filling range up to size (analogous to `memory.fill`) * The `table.init` instruction takes an additional table index as immediate. - `table.init $x $y : [i32 i32 i32] -> []` diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 9f2c802a4a..8e1d2aaaf1 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -18,7 +18,7 @@ packed data in one instruction. These are commonly used to improve performance for multimedia applications. The set of SIMD instructions in hardware is large, and varies across different versions of hardware. This proposal is comprised of a portable subset of operations that in most cases map to commonly used -instructions in mordern hardware. +instructions in modern hardware. # Types @@ -136,14 +136,14 @@ Accessing WebAssembly module imports or exports containing SIMD Type from JavaSc ### Module Function Imports -Calling an imported function from JavaScript when the function arguments or result is of type v128 will cause the host function to immidiately throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). +Calling an imported function from JavaScript when the function arguments or result is of type v128 will cause the host function to immediately throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). ### Exported Function Exotic Objects -Invoking the [[Call]] method of an Exported Function Exotic Object when the function type of its [[Closure]] has an argument or result of type v128 will cause the host function to immidiately throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). +Invoking the [[Call]] method of an Exported Function Exotic Object when the function type of its [[Closure]] has an argument or result of type v128 will cause the host function to immediately throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror). -## WebAssembly Module Instatiation +## WebAssembly Module Instantiation Instantiating a WebAssembly Module from a Module moduleObject will throw a LinkError exception, when the global's valtype is v128 and the imported objects type is not WebAssembly.Global. diff --git a/test/core/float_exprs.wast b/test/core/float_exprs.wast index 1f88299212..e6d4f10e91 100644 --- a/test/core/float_exprs.wast +++ b/test/core/float_exprs.wast @@ -1986,7 +1986,7 @@ (assert_return (invoke "f64.xkcd_better_sqrt_5" (f64.const 13.0) (f64.const 4.0) (f64.const 0x1.921fb54442d18p+1) (f64.const 24.0)) (f64.const 0x1.1e3778509a5a3p+1)) ;; Compute the floating-point radix. -;; M. A. Malcom. Algorithms to reveal properties of floating-point arithmetic. +;; M. A. Malcolm. Algorithms to reveal properties of floating-point arithmetic. ;; Communications of the ACM, 15(11):949-951, November 1972. (module (func (export "f32.compute_radix") (param $0 f32) (param $1 f32) (result f32) diff --git a/test/core/simd/simd_load.wast b/test/core/simd/simd_load.wast index 4b2edc160b..2fddd3019e 100644 --- a/test/core/simd/simd_load.wast +++ b/test/core/simd/simd_load.wast @@ -1,4 +1,4 @@ -;; v128.load operater with normal argument (e.g. (i8x16, i16x8 i32x4)) +;; v128.load operator with normal argument (e.g. (i8x16, i16x8 i32x4)) (module (memory 1) @@ -13,7 +13,7 @@ (assert_return (invoke "v128.load") (v128.const i32x4 0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c)) -;; v128.load operater as the argument of other SIMD instructions +;; v128.load operator as the argument of other SIMD instructions (module (memory 1) (data (i32.const 0) "\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f\00\01\02\03") @@ -185,4 +185,4 @@ (assert_invalid (module (memory 1) (func (drop (v128.load)))) "type mismatch" -) \ No newline at end of file +) diff --git a/test/core/simd/simd_store.wast b/test/core/simd/simd_store.wast index 50349c41bd..7bba053d8e 100644 --- a/test/core/simd/simd_store.wast +++ b/test/core/simd/simd_store.wast @@ -1,4 +1,4 @@ -;; v128.store operater with normal argument (e.g. (i8x16, i16x8, i32x4, f32x4)) +;; v128.store operator with normal argument (e.g. (i8x16, i16x8, i32x4, f32x4)) (module (memory 1) diff --git a/test/core/utf8-custom-section-id.wast b/test/core/utf8-custom-section-id.wast index ee5fd7ccb7..c3765d9da8 100644 --- a/test/core/utf8-custom-section-id.wast +++ b/test/core/utf8-custom-section-id.wast @@ -136,7 +136,7 @@ "malformed UTF-8 encoding" ) -;; byte after (first) 2-byte prefix not a contination byte +;; byte after (first) 2-byte prefix not a continuation byte (assert_malformed (module binary "\00asm" "\01\00\00\00" diff --git a/test/core/utf8-import-field.wast b/test/core/utf8-import-field.wast index 0d030dabb1..330ecf61c8 100644 --- a/test/core/utf8-import-field.wast +++ b/test/core/utf8-import-field.wast @@ -201,7 +201,7 @@ "malformed UTF-8 encoding" ) -;; byte after (first) 2-byte prefix not a contination byte +;; byte after (first) 2-byte prefix not a continuation byte (assert_malformed (module binary "\00asm" "\01\00\00\00" diff --git a/test/core/utf8-import-module.wast b/test/core/utf8-import-module.wast index 5a092da08a..8f509159d7 100644 --- a/test/core/utf8-import-module.wast +++ b/test/core/utf8-import-module.wast @@ -201,7 +201,7 @@ "malformed UTF-8 encoding" ) -;; byte after (first) 2-byte prefix not a contination byte +;; byte after (first) 2-byte prefix not a continuation byte (assert_malformed (module binary "\00asm" "\01\00\00\00"