Calling Symbol
with the new
operator throws a TypeError
exception.
Apply with the Grit CLI
grit apply no_new_symbol
Remove new
from Symbol
constructor
BEFORE
var bar = new Symbol('bar');
AFTER
var bar = Symbol('bar');
Do not remove new
from shadowed Symbol
constructor
JAVASCRIPT
function woo(Symbol) { const foo = new Symbol('foo'); }