Skip to content

Commit

Permalink
add engine-to-string to compat-table.js
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Mar 15, 2021
1 parent d943e89 commit 51b785f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions scripts/compat-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ const (
${engines.map((x, i) => `\t${upper(x)}${i ? '' : ' Engine = iota'}`).join('\n')}
)
func (e Engine) String() string {
\tswitch e {
${engines.map((x, i) => `\tcase ${upper(x)}:\n\t\treturn "${x}"`).join('\n')}
\t}
\treturn ""
}
type JSFeature uint64
const (
Expand Down
4 changes: 2 additions & 2 deletions scripts/js-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3294,11 +3294,11 @@ let transformTests = {

async multipleEngineTargetsNotSupported({ esbuild }) {
try {
await esbuild.transform(`0n`, { target: ['chrome1', 'safari2', 'firefox3'] })
await esbuild.transform(`0n`, { target: ['es5', 'chrome1', 'safari2', 'firefox3'] })
throw new Error('Expected an error to be thrown')
} catch (e) {
assert.strictEqual(e.errors[0].text,
'Big integer literals are not available in the configured target environment ("chrome1", "firefox3", "safari2")')
'Big integer literals are not available in the configured target environment ("chrome1", "es5", "firefox3", "safari2")')
}
},

Expand Down

0 comments on commit 51b785f

Please sign in to comment.