es3-safe-recast

esprima/recast es3 safe compile step


License
ISC
Install
npm install es3-safe-recast@2.0.0

Documentation

es3-safe-recast Build Status

Recasts all ECMAScript 3 reserved words to their safe alternatives.

Optionally removes trailing commas in object and array literals (pass { trailingComma: true } as the second argument to compile).

helpers

Before

ajax('/asdf/1').catch(function(reason) {

}).finally(function() {

});

After

ajax('/asdf/1')['catch'](function(reason) {

})['finally'](function() {

});

Before

object = {
  catch:   function() {},
  finally: function() {},
  default: function() {}
};

After

object = {
  'catch':   function() {},
  'finally': function() {},
  'default': function() {}
};