musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Major: No longer support pre-ES5 browsers #77

Closed iccir closed 8 years ago

iccir commented 8 years ago

Right now, oj has workarounds for browsers which don't allow "Reserved words as property names" (see ES5 compatibility table).

This includes: IE8 Safari 5.0 Chrome 6 Opera 10

Going forward, I'd like to officially state that oj generates ES5-compatible code, and drop official support for non-ES5-compatible browsers.

iccir commented 8 years ago

The major compatibility issue here is the class method, which is both an oj base object selector and a js reserved word.

IngwiePhoenix commented 8 years ago

class is reserved in ES5, but how about ES6?

iccir commented 8 years ago

Still a reserved word, but it's ok: reserved words can be used as property names:

// Legal in ES5+, error in older browsers
var o = { class: "Foo" };  console.log(o.class);

See "Reserved Word Usage" here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar

iccir commented 8 years ago

On 2.0 branch