remove the strict option entirely

This commit is contained in:
Evan Wallace
2020-10-26 00:53:22 -07:00
parent aa00fff4ad
commit 4c00b53703
18 changed files with 151 additions and 364 deletions

View File

@@ -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

View File

@@ -195,11 +195,6 @@
</select>
</label>
<br>
<label for="strict">
<input id="strict" type="checkbox">
Strict
</label>
&nbsp; &nbsp;
<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'))