Makes JS runtime more strict.
class Foo extends Object {
get name(){ return 'Jin' }
}
const foo = new Foo
`Hello, ${ foo }!`
// "Hello [object Object]!"
`In this month you have earned ${ foo / 1000 } thousand of dollars.`
// "In this month you have earned NaN thousand of dollars."
`Your "${ 'foo'[4] }" goal is finally achieved.`
// "Your "undefined" goal is finally achieved."
`There are still ${ foo.length - 1 } goals left and you will achieve success.`
// "There are still NaN goals left and you will achieve success."
`There are still ${ foo.length - 1 } goals left and you will achieve success.`
// "There are still NaN goals left and you will achieve success."
foo.__proto__= { name: 'moron' };
`See you later, ${ foo.name }.`
// "See you later, moron."
class Foo extends Object {
get name(){ return 'Jin' }
}
const foo = new Foo
`Hello, ${ foo }!`
// TypeError: Field "Symbol(Symbol.toPrimitive)" is not defined
`In this month you have earned ${ foo / 1000 } thousand of dollars.`
// TypeError: Field "Symbol(Symbol.toPrimitive)" is not defined
`Your "${ 'foo'[4] }" goal is finally achieved.`
// TypeError: Field "4" is not defined
`There are still ${ foo.length - 1 } goals left and you will achieve success.`
// TypeError: Field "length" is not defined
foo.__proto__= { name: 'moron' };
`See you later, ${ foo.name }.`
// "See you later, Jin."
At any *.meta.tree
:
include \/mol/strict
import "mol_strict"