diff options
author | rhysd <lin90162@yahoo.co.jp> | 2021-07-13 23:05:17 +0900 |
---|---|---|
committer | Richard Musiol <neelance@gmail.com> | 2021-09-03 19:56:09 +0000 |
commit | 04d8d249600bf7b350454175c521e0c251785956 (patch) | |
tree | b2b031d62d5d07203bc4d47e8c51974d9d539ad2 /misc/wasm | |
parent | 52aef05498a9e84ede16fb7ce46a2a252af05479 (diff) | |
download | go-git-04d8d249600bf7b350454175c521e0c251785956.tar.gz |
misc/wasm: enable ECMAScript strict mode
Current wasm_exec.js does not enable ECMAScript strict mode. But it is
recommended to be enabled because it
1. eliminates some ECMAScript silent errors by changing them to throw
errors
2. fixes mistakes that make it difficult for JavaScript engines to
perform optimizations
3. prohibits some syntax likely to be defined in future versions of
ECMAScript
This commit enables ECMAScript strict mode in wasm_exec.js following the
transition guide:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode
Fixes #47116
Change-Id: Ib8ffceee37e9127698fb51304241f1e429efe83e
Reviewed-on: https://go-review.googlesource.com/c/go/+/334269
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Richard Musiol <neelance@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'misc/wasm')
-rw-r--r-- | misc/wasm/wasm_exec.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index 231185a123..22b19fbe80 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -1,6 +1,7 @@ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +"use strict"; (() => { // Map multiple JavaScript environments to a single common API, |