mirror of
https://github.com/zhigang1992/esbuild.git
synced 2026-04-30 02:16:12 +08:00
remove the strict option entirely
This commit is contained in:
@@ -1131,17 +1131,6 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let called = false
|
||||
class Foo {
|
||||
foo
|
||||
set foo(x) { called = true }
|
||||
}
|
||||
new Foo()
|
||||
if (!called) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
'in.js': `
|
||||
let setterCalls = 0
|
||||
class Foo {
|
||||
@@ -1152,7 +1141,7 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
if (setterCalls !== 0 || !foo.hasOwnProperty('key') || foo.key !== void 0) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let setterCalls = 0
|
||||
class Foo {
|
||||
@@ -1163,7 +1152,7 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
if (setterCalls !== 0 || !foo.hasOwnProperty('key') || foo.key !== 123) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let toStringCalls = 0
|
||||
let setterCalls = 0
|
||||
@@ -1178,7 +1167,7 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
if (setterCalls !== 0 || toStringCalls !== 1 || !foo.hasOwnProperty('key') || foo.key !== void 0) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let toStringCalls = 0
|
||||
let setterCalls = 0
|
||||
@@ -1193,7 +1182,7 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
if (setterCalls !== 0 || toStringCalls !== 1 || !foo.hasOwnProperty('key') || foo.key !== 123) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let key = Symbol('key')
|
||||
let setterCalls = 0
|
||||
@@ -1205,7 +1194,7 @@ in.js:24:30: warning: Writing to getter-only property "#getter" will throw
|
||||
if (setterCalls !== 0 || !foo.hasOwnProperty(key) || foo[key] !== void 0) throw 'fail'
|
||||
`,
|
||||
}),
|
||||
test(['in.js', '--outfile=node.js', '--target=es6', '--strict'], {
|
||||
test(['in.js', '--outfile=node.js', '--target=es6'], {
|
||||
'in.js': `
|
||||
let key = Symbol('key')
|
||||
let setterCalls = 0
|
||||
|
||||
@@ -195,11 +195,6 @@
|
||||
</select>
|
||||
</label>
|
||||
<br>
|
||||
<label for="strict">
|
||||
<input id="strict" type="checkbox">
|
||||
Strict
|
||||
</label>
|
||||
|
||||
<label for="ascii">
|
||||
<input id="ascii" type="checkbox">
|
||||
ASCII
|
||||
@@ -225,7 +220,6 @@
|
||||
const minifySyntax = document.querySelector('#minify-syntax')
|
||||
const minifyIdents = document.querySelector('#minify-idents')
|
||||
const minifySpaces = document.querySelector('#minify-spaces')
|
||||
const strict = document.querySelector('#strict')
|
||||
const ascii = document.querySelector('#ascii')
|
||||
let runIfIdle
|
||||
|
||||
@@ -265,7 +259,6 @@
|
||||
persistChecked(minifySyntax, 'minifySyntax')
|
||||
persistChecked(minifyIdents, 'minifyIdents')
|
||||
persistChecked(minifySpaces, 'minifySpaces')
|
||||
persistChecked(strict, 'strict')
|
||||
persistChecked(ascii, 'ascii')
|
||||
|
||||
try {
|
||||
@@ -305,7 +298,6 @@
|
||||
minifySyntax: minifySyntax.checked,
|
||||
minifyIdentifiers: minifyIdents.checked,
|
||||
minifyWhitespace: minifySpaces.checked,
|
||||
strict: strict.checked,
|
||||
charset: ascii.checked ? 'ascii' : 'utf8',
|
||||
}).then(({ code, warnings }) => {
|
||||
let html = messagesToHTML(addKindToMessages(warnings, 'warning'))
|
||||
|
||||
Reference in New Issue
Block a user