# Conflicts: # CONTRIBUTING.md # cspell.json # docs/options.md # package.json # scripts/build/bundler.mjs # src/language-css/loc.js # src/language-css/parser-postcss.js # src/language-css/utils/index.js # tests/format/js/arrows-bind/jsfmt.spec.js # tests/format/js/async-do-expressions/jsfmt.spec.js # tests/format/js/bind-expressions/jsfmt.spec.js # tests/format/js/classes/top-level-super/jsfmt.spec.js # tests/format/js/comments-pipeline-own-line/jsfmt.spec.js # tests/format/js/decorator-comments/jsfmt.spec.js # tests/format/js/decorators-export/jsfmt.spec.js # tests/format/js/decorators/jsfmt.spec.js # tests/format/js/do/jsfmt.spec.js # tests/format/js/export-default/escaped/jsfmt.spec.js # tests/format/js/export-extension/jsfmt.spec.js # tests/format/js/export-star/jsfmt.spec.js # tests/format/js/exports/jsfmt.spec.js # tests/format/js/invalid-code/jsfmt.spec.js # tests/format/js/logical-assignment/jsfmt.spec.js # tests/format/js/multiparser-invalid/jsfmt.spec.js # tests/format/js/no-semi-babylon-extensions/jsfmt.spec.js # tests/format/js/object-property-comment/jsfmt.spec.js # tests/format/js/partial-application/jsfmt.spec.js # tests/format/js/pipeline-operator/jsfmt.spec.js # tests/format/js/private-in/jsfmt.spec.js # tests/format/js/record/jsfmt.spec.js # tests/format/js/reserved-word/jsfmt.spec.js # tests/format/js/strings/jsfmt.spec.js # tests/format/js/throw_expressions/jsfmt.spec.js # tests/format/js/trailing-whitespace/jsfmt.spec.js # tests/format/js/v8_intrinsic/jsfmt.spec.js # tests/format/misc/errors/js/literal/jsfmt.spec.js # tests/format/misc/errors/js/object/jsfmt.spec.js # tests/format/misc/errors/js/variable-declarator/jsfmt.spec.js # tests/integration/__tests__/bundle.js # tsconfig.json # yarn.lock
22 lines
598 B
JavaScript
22 lines
598 B
JavaScript
import { outdent } from "outdent";
|
|
|
|
run_spec(
|
|
{
|
|
importMeta: import.meta,
|
|
snippets: [
|
|
"const baz3 = new obj?.foo?.bar?.baz(); // baz instance",
|
|
"const safe5 = new obj?.qux?.baz(); // undefined",
|
|
"const safe6 = new obj?.foo.bar.qux?.(); // undefined",
|
|
"const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor",
|
|
outdent`
|
|
// Top classes can be called directly, too.
|
|
class Test {
|
|
}
|
|
new Test?.(); // test instance
|
|
`,
|
|
"new exists?.(); // undefined",
|
|
],
|
|
},
|
|
["babel", "acorn", "espree", "meriyah"]
|
|
);
|