* 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
* op ast
* test expected errors
* use new ast methods
* remove unused abstraction
* logical ?
* fix rebase
* follow convention
* fixes from code review
* test helper naming
* always convert new to Call
* new cases
* don't mutate locationData
* include range in location data
* use exclusive ranges
* ast generation hooks
* fix getAstChildren()
* babylon -
* isArray -> Array.isArray
* pass options to toJSON()
* default astType on Base
* using exclusive range
* extract location data tests
* babylon -> ast
* remove do ->
* _toAst -> getAstContent
* Pass through parsed number value from lexer to node; don't process more than is necessary (a number literal can never be negative, because the negative sign is an Op token and node)
* normalize NumberLiteral values
* use parsedValue in getNumberValue()
* recursive getNumberValue()
* parseNumber()
* The core JavaScript Number constructor does a better job at parsing strings into numbers than our helper does
* Use Object.assign rather than merge or extend
* Update link
* Cleanup style
* Refactor to make AST generation more object-oriented: have each of the AST properties be generated on the node itself, rather than in loops in the base class
* Untangle test helpers: give the AST location tests their own specific helper function, and move the general AST helper functions into the main AST tests file
* Not passing o
* Add node type check to AST location data tests
* Port to Babel 7
Use the Babel 7 @babel/core transpiler, falling back to the older babel-core version if possible.
* Use Babel 7 and preset-env 7 to build the browser compiler and test Babel transpilation
* Update docs for Babel 7