/* * comment * comment * comment */ "use strict" 'use strict' import foo from '../foo'; // comment // comment // comment const a = 0; let b = 1; var c = 2; // comment // regex test [/.*/, /\/[a-z\d]+\//g] [//] this should be a comment [/*/] nothing to repeat, this should be a comment */ // reserved words as object property test class FooClass {} const foo = new FooClass; foo.class = 1; foo.bar = {class: 0}; foo.baz = { get: function() {}, set: function() {}, get foo: function() {}, set foo: function() {} }; // object property test window.foo = { key: 'value', '#': 4, "@": true, [foo.toString()]: "" }; // object shorthand test {foo, bar, baz, qux: 1} // object chaining test console.log(foo?.bar?.baz?.qux); // function test function *foo(a, b, c = 4) { yield a + b + c; } function bar( a, // comment 1 b, // comment 2 c = 4 /* comment 3 */ ) {} // function call test foo('a', true, 1); bar = bar.replace(/\W+/g, '-'); // class and method test interface FooInterface { bar() {} baz() {} toString() {} } class Foo implements FooInterface { constructor() { this.foo = 1 this.bar = 'baz' this.#baz = 0 } bar() { return this.bar } baz() { return undefined } toString() { return `foo bar ${baz + 1}` } } class Bar extends Foo { constructor() { super() } } // JSX test class Button extends React.Component { render() { return } } const button = new Button; export default Button;