@GeoffreyBooth PR for class static methods/static properties
Remaining parts of class ASTs include bound/computed methods/properties and executable class bodies
* Build both a legacy and modern browser compiler
* Dynamic import example and documentation
* Update the docs to use the modern browser compiler if the browser supports it
* Update policy regarding Stage 3 features
* This never made sense, and assigning a string to index 0 *of a string* throws in Module mode (and silently does nothing in Script mode) so remove this unneeded code that throws when compiling `fn for i from from iterable` in Module mode
* Have browser-based tests use the ES module version if supported
* Simplify building logic
* Update output
* For the ES module version of the browser compiler, don't automatically attach the runScripts event handler
* Consistent comments
* Fix comment
The `rli` property is just a reference to itself. It still exists
for legacy reasons but it will likely be removed in a future major
version. This makes sure everything works as expected.
* Add test for #5085
$ cake test
failed 1 and passed 1274 tests in 4.81 seconds
#5085: Bug: @ reference to class not maintained in do block
AssertionError [ERR_ASSERTION]: Expected undefined to equal 2
* Fix#5085: @ reference to class in "do" block
Assuming that a bound Code node inside an ExecutableClassBody without a
name must be a "do" block.
* Additional tests
https://github.com/jashkenas/coffeescript/pull/5145#issuecomment-462127244
Also switched to concat'g strings for test values, as opposed to
incrementing numbers: makes the tests a bit easier to read.
* root ast
* updated grammar
* preserve CoffeeScript.nodes() API
* root ast methods
* updates from code review
* Style
* Fix a few missing returns
* Expand sourceType explanation
* Simplify
* Refactor Block.astProperties: use expression.astLocationData() to get location data, rather than extracting it from the whole AST object; move all the logic into one function, rather than spreading it out across several functions on the Block class that all appear to be internal
* testing root location data
* Fix location end data for root/File » Program AST node
* implement coffeescript._addSoucrse method
This method enables an external module to implement caching of
compilation results. When the compiled js source is loaded from cache,
the original coffee code should be added with this method in order to
enable the Error.prepareStackTrace below to correctly adjust the stack
trace for the corresponding file (the source map will be generated on
demand).
* replace _addSource with registerCompiled
* extract the logic from _compileFile into _compileRawFileContent
_compileFile takes care of logging the file and calls _compileRawFileContent
this way an external caching implementation which computes cache key
based on raw content of the sources file, can reuse the logic of
_compileFile and avoid having calling `fs.readFileSync` for the file
more twice in case of cache miss
* remove 'output' argument from registerCompiled