es3-safe-recast

esprima/recast es3 safe compile step

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
es3-safe-recast
2113.0.06 years ago10 years agoMinified + gzip package size for es3-safe-recast in KB

Readme

es3-safe-recast Build Status
Recasts all ECMAScript 31 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() {}
};