> a word that describes the same code but running in a different environment
Uhm, that's a wrong way to think about it. The same code can't run in a two different environments. If it does then it means that the environment is the same! The question then becomes what is an 'environment'.
Once you start explicitly tracking what the dependencies of your code are, in terms of language/runtime support, external libraries etc, it becomes very clear what the 'environment' is (though JavaScript as a language is exceptionally bad at expressing these dependencies). If your code runs in Node.js and latest Chrome, then the 'environment' is ES5 or even ES6. If it also runs in IE7, then the environment likely is ES3. If your code also needs access to the DOM and WebWorker APIs, as well as underscore, then the environment is ES3+DOM+WebWorker+underscore.
If only we had support in the language and/or tooling around it to express these dependencies and warn us if we try to use some code in an environment that is unsuitable for it...
Uhm, that's a wrong way to think about it. The same code can't run in a two different environments. If it does then it means that the environment is the same! The question then becomes what is an 'environment'.
Once you start explicitly tracking what the dependencies of your code are, in terms of language/runtime support, external libraries etc, it becomes very clear what the 'environment' is (though JavaScript as a language is exceptionally bad at expressing these dependencies). If your code runs in Node.js and latest Chrome, then the 'environment' is ES5 or even ES6. If it also runs in IE7, then the environment likely is ES3. If your code also needs access to the DOM and WebWorker APIs, as well as underscore, then the environment is ES3+DOM+WebWorker+underscore.
If only we had support in the language and/or tooling around it to express these dependencies and warn us if we try to use some code in an environment that is unsuitable for it...