0

please, I need your help:

I have this problem: I'm working with an old system in asp.net, the Javascript for these aspx pages was implemented with ES3 so I cant run these pages on Microsoft Edge (ES7). I need something similar to babel but with inverse process, I need to shim ES3 to ES7, in this case, I can run my old aspx pages in Edge. Any ideas?

Hannes Karppila
  • 969
  • 2
  • 13
  • 31
Super Javi
  • 11
  • 4
  • 2
    What doesn't work? – Dave Newton Mar 12 '18 at 18:28
  • Honestly? You'll probably need to refactor the code. ES3 hasn't been a standard for many years now, and some of that code probably isn't working in a number of browsers (not just Edge). Find what isn't working, specifically, and target it for refactor. I don't know of any tools that will do this for you, necessarily, but the first thing you might do is run your js through ESLint. If you have some modern rules set (You can find many profiles prebuilt. The one from AirBnB is really good), it can help you find specific bits that need update. – Steve -Cutter- Blades Oct 29 '18 at 12:50
  • https://medium.com/@mutebg/improve-your-javascript-code-quality-with-the-right-tools-aafb5db2acf7 – Steve -Cutter- Blades Oct 29 '18 at 12:51

1 Answers1

0

edge is not es3, it's es6

yes, you can install babel-core (@babel/core / version 7 won't work because nobody has bothered to update the shims,) and babel-preset-env and babel-preset-es3, and transcompile

but if you're in edge you don't need that. just use es6

i assume you're actually in ie7, because that's the last thing microsoft made without complete es5 support

your .babelrc is going to end up with a section that looks like

{
  "presets": ["env", "es3"]
}
John Haugeland
  • 9,230
  • 3
  • 37
  • 40