Showing preview only (8,487K chars total). Download the full file or copy to clipboard to get everything.
Repository: jashkenas/coffeescript
Branch: main
Commit: 817c39a13065
Files: 421
Total size: 8.0 MB
Directory structure:
gitextract_u1pht3mv/
├── .babelrc
├── .github/
│ └── workflows/
│ └── continuous-integration.yml
├── .gitignore
├── .nojekyll
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cakefile
├── ISSUE_TEMPLATE.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── bin/
│ ├── cake
│ └── coffee
├── bower.json
├── docs/
│ ├── CNAME
│ ├── browserconfig.xml
│ ├── manifest.json
│ ├── v1/
│ │ ├── annotated-source/
│ │ │ ├── browser.html
│ │ │ ├── cake.html
│ │ │ ├── coffee-script.html
│ │ │ ├── command.html
│ │ │ ├── docco.css
│ │ │ ├── grammar.html
│ │ │ ├── helpers.html
│ │ │ ├── index.html
│ │ │ ├── lexer.html
│ │ │ ├── nodes.html
│ │ │ ├── optparse.html
│ │ │ ├── public/
│ │ │ │ └── stylesheets/
│ │ │ │ └── normalize.css
│ │ │ ├── register.html
│ │ │ ├── repl.html
│ │ │ ├── rewriter.html
│ │ │ ├── scope.html
│ │ │ └── sourcemap.html
│ │ ├── browser-compiler/
│ │ │ └── coffee-script.js
│ │ ├── index.html
│ │ └── test.html
│ └── v2/
│ ├── annotated-source/
│ │ ├── browser.html
│ │ ├── cake.html
│ │ ├── coffeescript.html
│ │ ├── command.html
│ │ ├── docco.css
│ │ ├── grammar.html
│ │ ├── helpers.html
│ │ ├── index.html
│ │ ├── lexer.html
│ │ ├── nodes.html
│ │ ├── optparse.html
│ │ ├── public/
│ │ │ └── stylesheets/
│ │ │ └── normalize.css
│ │ ├── register.html
│ │ ├── repl.html
│ │ ├── rewriter.html
│ │ ├── scope.html
│ │ └── sourcemap.html
│ ├── announcing-coffeescript-2/
│ │ └── index.html
│ ├── browser-compiler-legacy/
│ │ └── coffeescript.js
│ ├── browser-compiler-modern/
│ │ └── coffeescript.js
│ ├── index.html
│ └── test.html
├── documentation/
│ ├── examples/
│ │ ├── aliases.coffee
│ │ ├── array_comprehensions.coffee
│ │ ├── array_spread.coffee
│ │ ├── async.coffee
│ │ ├── breaking_change_bound_generator_function.coffee
│ │ ├── breaking_change_destructuring_default_values.coffee
│ │ ├── breaking_change_fat_arrow.coffee
│ │ ├── breaking_change_function_parameter_default_values.coffee
│ │ ├── breaking_change_super_in_non-class_methods_refactor_with_apply.coffee
│ │ ├── breaking_change_super_in_non-class_methods_refactor_with_class.coffee
│ │ ├── breaking_change_super_this.coffee
│ │ ├── breaking_change_super_with_arguments.coffee
│ │ ├── breaking_change_super_without_arguments.coffee
│ │ ├── cake_tasks.coffee
│ │ ├── chaining.coffee
│ │ ├── classes.coffee
│ │ ├── comment.coffee
│ │ ├── comparisons.coffee
│ │ ├── conditionals.coffee
│ │ ├── constructor_destructuring.coffee
│ │ ├── default_args.coffee
│ │ ├── do.coffee
│ │ ├── dynamic_import.coffee
│ │ ├── embedded.coffee
│ │ ├── embedded_block.coffee
│ │ ├── embedded_escaped.coffee
│ │ ├── existence.coffee
│ │ ├── existence_declared.coffee
│ │ ├── existence_undeclared.coffee
│ │ ├── expansion.coffee
│ │ ├── expressions.coffee
│ │ ├── expressions_assignment.coffee
│ │ ├── expressions_comprehension.coffee
│ │ ├── expressions_try.coffee
│ │ ├── fat_arrow.coffee
│ │ ├── functions.coffee
│ │ ├── generator_iteration.coffee
│ │ ├── generators.coffee
│ │ ├── get_set.coffee
│ │ ├── heredocs.coffee
│ │ ├── heregexes.coffee
│ │ ├── interpolation.coffee
│ │ ├── jsx.coffee
│ │ ├── modules.coffee
│ │ ├── modulo.coffee
│ │ ├── multiple_return_values.coffee
│ │ ├── object_comprehensions.coffee
│ │ ├── object_extraction.coffee
│ │ ├── object_spread.coffee
│ │ ├── objects_and_arrays.coffee
│ │ ├── objects_reserved.coffee
│ │ ├── objects_shorthand.coffee
│ │ ├── overview.coffee
│ │ ├── parallel_assignment.coffee
│ │ ├── patterns_and_splats.coffee
│ │ ├── prototypes.coffee
│ │ ├── range_comprehensions.coffee
│ │ ├── scope.coffee
│ │ ├── slices.coffee
│ │ ├── soaks.coffee
│ │ ├── splats.coffee
│ │ ├── splices.coffee
│ │ ├── static.coffee
│ │ ├── strings.coffee
│ │ ├── switch.coffee
│ │ ├── switch_with_no_expression.coffee
│ │ ├── tagged_template_literals.coffee
│ │ ├── try.coffee
│ │ ├── type_annotations.coffee
│ │ └── while.coffee
│ ├── sections/
│ │ ├── annotated_source.md
│ │ ├── announcing_coffeescript_2.md
│ │ ├── async_functions.md
│ │ ├── books.md
│ │ ├── breaking_changes.md
│ │ ├── breaking_changes_argument_parsing_and_shebang_lines.md
│ │ ├── breaking_changes_bound_generator_functions.md
│ │ ├── breaking_changes_classes.md
│ │ ├── breaking_changes_default_values.md
│ │ ├── breaking_changes_fat_arrow.md
│ │ ├── breaking_changes_jsx_and_the_less_than_and_greater_than_operators.md
│ │ ├── breaking_changes_literate_coffeescript.md
│ │ ├── breaking_changes_super_extends.md
│ │ ├── breaking_changes_super_this.md
│ │ ├── cake.md
│ │ ├── chaining.md
│ │ ├── changelog/
│ │ │ ├── 0.1.0.md
│ │ │ ├── 0.1.1.md
│ │ │ ├── 0.1.2.md
│ │ │ ├── 0.1.3.md
│ │ │ ├── 0.1.4.md
│ │ │ ├── 0.1.5.md
│ │ │ ├── 0.1.6.md
│ │ │ ├── 0.2.0.md
│ │ │ ├── 0.2.1.md
│ │ │ ├── 0.2.2.md
│ │ │ ├── 0.2.3.md
│ │ │ ├── 0.2.4.md
│ │ │ ├── 0.2.5.md
│ │ │ ├── 0.2.6.md
│ │ │ ├── 0.3.0.md
│ │ │ ├── 0.3.2.md
│ │ │ ├── 0.5.0.md
│ │ │ ├── 0.5.1.md
│ │ │ ├── 0.5.2.md
│ │ │ ├── 0.5.3.md
│ │ │ ├── 0.5.4.md
│ │ │ ├── 0.5.5.md
│ │ │ ├── 0.5.6.md
│ │ │ ├── 0.6.0.md
│ │ │ ├── 0.6.1.md
│ │ │ ├── 0.6.2.md
│ │ │ ├── 0.7.0.md
│ │ │ ├── 0.7.1.md
│ │ │ ├── 0.7.2.md
│ │ │ ├── 0.9.0.md
│ │ │ ├── 0.9.1.md
│ │ │ ├── 0.9.2.md
│ │ │ ├── 0.9.3.md
│ │ │ ├── 0.9.4.md
│ │ │ ├── 0.9.5.md
│ │ │ ├── 0.9.6.md
│ │ │ ├── 1.0.0.md
│ │ │ ├── 1.0.1.md
│ │ │ ├── 1.1.0.md
│ │ │ ├── 1.1.1.md
│ │ │ ├── 1.1.2.md
│ │ │ ├── 1.1.3.md
│ │ │ ├── 1.10.0.md
│ │ │ ├── 1.11.0.md
│ │ │ ├── 1.11.1.md
│ │ │ ├── 1.12.0.md
│ │ │ ├── 1.12.1.md
│ │ │ ├── 1.12.2.md
│ │ │ ├── 1.12.3.md
│ │ │ ├── 1.12.4.md
│ │ │ ├── 1.12.5.md
│ │ │ ├── 1.12.6.md
│ │ │ ├── 1.12.7.md
│ │ │ ├── 1.2.0.md
│ │ │ ├── 1.3.1.md
│ │ │ ├── 1.3.3.md
│ │ │ ├── 1.4.0.md
│ │ │ ├── 1.5.0.md
│ │ │ ├── 1.6.1.md
│ │ │ ├── 1.6.2.md
│ │ │ ├── 1.6.3.md
│ │ │ ├── 1.7.0.md
│ │ │ ├── 1.7.1.md
│ │ │ ├── 1.8.0.md
│ │ │ ├── 1.9.0.md
│ │ │ ├── 1.9.1.md
│ │ │ ├── 1.9.2.md
│ │ │ ├── 1.9.3.md
│ │ │ ├── 2.0.0-alpha1.md
│ │ │ ├── 2.0.0-beta1.md
│ │ │ ├── 2.0.0-beta2.md
│ │ │ ├── 2.0.0-beta3.md
│ │ │ ├── 2.0.0-beta4.md
│ │ │ ├── 2.0.0-beta5.md
│ │ │ ├── 2.0.0.md
│ │ │ ├── 2.0.1.md
│ │ │ ├── 2.0.2.md
│ │ │ ├── 2.0.3.md
│ │ │ ├── 2.1.0.md
│ │ │ ├── 2.1.1.md
│ │ │ ├── 2.2.0.md
│ │ │ ├── 2.2.1.md
│ │ │ ├── 2.2.2.md
│ │ │ ├── 2.2.3.md
│ │ │ ├── 2.2.4.md
│ │ │ ├── 2.3.0.md
│ │ │ ├── 2.3.1.md
│ │ │ ├── 2.3.2.md
│ │ │ ├── 2.4.0.md
│ │ │ ├── 2.4.1.md
│ │ │ ├── 2.5.0.md
│ │ │ ├── 2.5.1.md
│ │ │ ├── 2.6.0.md
│ │ │ ├── 2.6.1.md
│ │ │ └── 2.7.0.md
│ │ ├── changelog.md
│ │ ├── chat.md
│ │ ├── classes.md
│ │ ├── coffeescript_2.md
│ │ ├── command_line_interface.md
│ │ ├── comments.md
│ │ ├── comparisons.md
│ │ ├── compatibility.md
│ │ ├── conditionals.md
│ │ ├── contributing.md
│ │ ├── destructuring.md
│ │ ├── embedded.md
│ │ ├── examples.md
│ │ ├── existential_operator.md
│ │ ├── expressions.md
│ │ ├── fat_arrow.md
│ │ ├── functions.md
│ │ ├── generators.md
│ │ ├── heregexes.md
│ │ ├── installation.md
│ │ ├── integrations.md
│ │ ├── integrations_build_tools.md
│ │ ├── integrations_code_editors.md
│ │ ├── integrations_frameworks.md
│ │ ├── integrations_linters_and_formatting.md
│ │ ├── integrations_testing.md
│ │ ├── introduction.md
│ │ ├── jsx.md
│ │ ├── language.md
│ │ ├── lexical_scope.md
│ │ ├── literate.md
│ │ ├── loops.md
│ │ ├── modules.md
│ │ ├── nodejs_usage.md
│ │ ├── objects_and_arrays.md
│ │ ├── operators.md
│ │ ├── overview.md
│ │ ├── prototypal_inheritance.md
│ │ ├── resources.md
│ │ ├── screencasts.md
│ │ ├── scripts.md
│ │ ├── slices.md
│ │ ├── source_maps.md
│ │ ├── splats.md
│ │ ├── strings.md
│ │ ├── switch.md
│ │ ├── tagged_template_literals.md
│ │ ├── test.md
│ │ ├── transpilation.md
│ │ ├── try.md
│ │ ├── type_annotations.md
│ │ ├── unsupported.md
│ │ ├── unsupported_get_set.md
│ │ ├── unsupported_let_const.md
│ │ ├── unsupported_named_functions.md
│ │ ├── usage.md
│ │ └── whats_new_in_coffeescript_2.md
│ └── site/
│ ├── body.html
│ ├── code.coffee
│ ├── code.css
│ ├── code.html
│ ├── docs.coffee
│ ├── docs.css
│ ├── index.html
│ ├── navbar.html
│ ├── scripts.html
│ ├── sidebar.html
│ ├── styles.html
│ ├── test.html
│ └── try.html
├── lib/
│ ├── coffeescript/
│ │ ├── browser.js
│ │ ├── cake.js
│ │ ├── coffeescript.js
│ │ ├── command.js
│ │ ├── grammar.js
│ │ ├── helpers.js
│ │ ├── index.js
│ │ ├── lexer.js
│ │ ├── nodes.js
│ │ ├── optparse.js
│ │ ├── parser.js
│ │ ├── register.js
│ │ ├── repl.js
│ │ ├── rewriter.js
│ │ ├── scope.js
│ │ └── sourcemap.js
│ ├── coffeescript-browser-compiler-legacy/
│ │ └── coffeescript.js
│ └── coffeescript-browser-compiler-modern/
│ └── coffeescript.js
├── package.json
├── register.js
├── repl.js
├── src/
│ ├── browser.coffee
│ ├── cake.coffee
│ ├── coffeescript.coffee
│ ├── command.coffee
│ ├── grammar.coffee
│ ├── helpers.coffee
│ ├── index.coffee
│ ├── lexer.coffee
│ ├── nodes.coffee
│ ├── optparse.coffee
│ ├── register.coffee
│ ├── repl.coffee
│ ├── rewriter.coffee
│ ├── scope.litcoffee
│ └── sourcemap.litcoffee
└── test/
├── abstract_syntax_tree.coffee
├── abstract_syntax_tree_location_data.coffee
├── argument_parsing.coffee
├── arrays.coffee
├── assignment.coffee
├── async.coffee
├── async_iterators.coffee
├── booleans.coffee
├── classes.coffee
├── cluster.coffee
├── comments.coffee
├── compilation.coffee
├── comprehensions.coffee
├── control_flow.coffee
├── error_messages.coffee
├── eval.coffee
├── exception_handling.coffee
├── exponentiation.coffee
├── formatting.coffee
├── function_invocation.coffee
├── functions.coffee
├── generators.coffee
├── helpers.coffee
├── import_assertions.coffee
├── importing/
│ ├── .coffee
│ ├── .coffee.md
│ ├── .import.coffee
│ ├── .import.coffee.md
│ ├── .import2
│ ├── error.coffee
│ ├── import.coffee
│ ├── import.coffee.md
│ ├── import.extension.coffee
│ ├── import.extension.coffee.md
│ ├── import.extension.js
│ ├── import.js
│ ├── import.litcoffee
│ ├── import.unknownextension
│ ├── import2
│ ├── index.coffee.md
│ ├── shebang.coffee
│ ├── shebang_extra_args.coffee
│ ├── shebang_initial_space.coffee
│ ├── shebang_initial_space_extra_args.coffee
│ └── transpile_import.coffee
├── importing.coffee
├── interpolation.coffee
├── invocation_argument_parsing.coffee
├── javascript_literals.coffee
├── jsx.coffee
├── literate.litcoffee
├── literate_tabbed.litcoffee
├── location.coffee
├── modules.coffee
├── numbers.coffee
├── numbers_bigint.coffee
├── numeric_literal_separators.coffee
├── object_rest_spread.coffee
├── objects.coffee
├── operators.coffee
├── option_parser.coffee
├── package.coffee
├── parser.coffee
├── ranges.coffee
├── regex.coffee
├── regex_dotall.coffee
├── repl.coffee
├── scope.coffee
├── slicing_and_splicing.coffee
├── soaks.coffee
├── sourcemap.coffee
├── strict.coffee
├── strings.coffee
├── support/
│ └── helpers.coffee
└── tagged_template_literals.coffee
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": ["@babel/env"]
}
================================================
FILE: .github/workflows/continuous-integration.yml
================================================
# Based on https://github.com/actions/starter-workflows/blob/master/ci/node.js.yml
name: Build and Test
on: [push, pull_request]
jobs:
ci:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
# Ensure that we can still build in the current version of Node
- run: node ./bin/cake build:except-parser
- run: node ./bin/cake build:parser
# Build twice to ensure that the latest build of the compiler can still build itself
- run: node ./bin/cake build:except-parser
- run: node ./bin/cake build:parser
# Build the browser compiler for the headless browser test
- run: node ./bin/cake build:browser
# Build test.html, so that test:browser uses the latest tests
- run: node ./bin/cake doc:test
# Check that the git diff is clean, to ensure that the updated build output was committed
- run: git diff --exit-code
# Test
- run: node ./bin/cake test
- run: node ./bin/cake test:browser || node ./bin/cake test:browser || node ./bin/cake test:browser
- run: node ./bin/cake test:browser:node
- run: node ./bin/cake test:integrations
================================================
FILE: .gitignore
================================================
raw
presentation
test.coffee
test*.coffee
test.litcoffee
test*.litcoffee
test/*.js
parser.output
/node_modules
npm-debug.log*
yarn.lock
.DS_Store
================================================
FILE: .nojekyll
================================================
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maintainers@coffeescript.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: CONTRIBUTING.md
================================================
## How to contribute to CoffeeScript
* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffeescript/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you’re just getting started with CoffeeScript, there’s a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffeescript.js` file. We’ll do those things before cutting a new release. You _should,_ however, commit the updated compiled JavaScript files in `lib`.
* To get started, read the guides in the wiki:
* [Hacking on the CoffeeScript Compiler](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-Hacking-on-the-CoffeeScript-Compiler)
* [How parsing works](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-How-parsing-works)
* [Update the docs](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-Update-the-docs)
================================================
FILE: Cakefile
================================================
fs = require 'fs'
os = require 'os'
path = require 'path'
_ = require 'underscore'
{ spawn, exec, execSync } = require 'child_process'
CoffeeScript = require './lib/coffeescript'
helpers = require './lib/coffeescript/helpers'
# ANSI Terminal Colors.
bold = red = green = yellow = reset = ''
unless process.env.NODE_DISABLE_COLORS
bold = '\x1B[0;1m'
red = '\x1B[0;31m'
green = '\x1B[0;32m'
yellow = '\x1B[0;33m'
reset = '\x1B[0m'
# Built file header.
header = """
/**
* CoffeeScript Compiler v#{CoffeeScript.VERSION}
* https://coffeescript.org
*
* Copyright 2011-#{new Date().getFullYear()}, Jeremy Ashkenas
* Released under the MIT License
*/
"""
# Used in folder names like `docs/v1`.
majorVersion = parseInt CoffeeScript.VERSION.split('.')[0], 10
# Log a message with a color.
log = (message, color, explanation) ->
console.log color + message + reset + ' ' + (explanation or '')
spawnNodeProcess = (args, output = 'stderr', callback) ->
relayOutput = (buffer) -> console.log buffer.toString()
proc = spawn 'node', args
proc.stdout.on 'data', relayOutput if output is 'both' or output is 'stdout'
proc.stderr.on 'data', relayOutput if output is 'both' or output is 'stderr'
proc.on 'exit', (status) -> callback(status) if typeof callback is 'function'
# Run a CoffeeScript through our node/coffee interpreter.
run = (args, callback) ->
spawnNodeProcess ['bin/coffee'].concat(args), 'stderr', (status) ->
process.exit(1) if status isnt 0
callback() if typeof callback is 'function'
# Build the CoffeeScript language from source.
buildParser = ->
helpers.extend global, require 'util'
require 'jison'
# We don't need `moduleMain`, since the parser is unlikely to be run standalone.
parser = require('./lib/coffeescript/grammar').parser.generate(moduleMain: ->)
fs.writeFileSync 'lib/coffeescript/parser.js', parser
buildExceptParser = (callback) ->
files = fs.readdirSync 'src'
files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/))
run ['-c', '-o', 'lib/coffeescript'].concat(files), callback
build = (callback) ->
buildParser()
buildExceptParser callback
transpile = (code, options = {}) ->
options.minify = process.env.MINIFY isnt 'false'
options.transform = process.env.TRANSFORM isnt 'false'
options.sourceType ?= 'script'
babel = require '@babel/core'
presets = []
# Exclude the `modules` plugin in order to not break the `}(this));`
# at the end of the `build:browser` code block.
presets.push ['@babel/env', {modules: no}] if options.transform
presets.push ['minify', {mangle: no, evaluate: no, removeUndefined: no}] if options.minify
babelOptions =
presets: presets
compact: options.minify
minified: options.minify
comments: not options.minify
sourceType: options.sourceType
{ code } = babel.transformSync code, babelOptions unless presets.length is 0
code
testBuiltCode = (watch = no) ->
csPath = './lib/coffeescript'
csDir = path.dirname require.resolve csPath
for mod of require.cache when csDir is mod[0 ... csDir.length]
delete require.cache[mod]
testResults = runTests require csPath
unless watch
process.exit 1 unless testResults
buildAndTest = (includingParser = yes, harmony = no) ->
process.stdout.write '\x1Bc' # Clear terminal screen.
execSync 'git checkout lib/*', stdio: 'inherit' # Reset the generated compiler.
buildArgs = ['bin/cake']
buildArgs.push if includingParser then 'build' else 'build:except-parser'
log "building#{if includingParser then ', including parser' else ''}...", green
spawnNodeProcess buildArgs, 'both', ->
log 'testing...', green
testArgs = if harmony then ['--harmony'] else []
testArgs = testArgs.concat ['bin/cake', 'test']
spawnNodeProcess testArgs, 'both'
watchAndBuildAndTest = (harmony = no) ->
buildAndTest yes, harmony
fs.watch 'src/', interval: 200, (eventType, filename) ->
if eventType is 'change'
log "src/#{filename} changed, rebuilding..."
buildAndTest (filename is 'grammar.coffee'), harmony
fs.watch 'test/', {interval: 200, recursive: yes}, (eventType, filename) ->
if eventType is 'change'
log "test/#{filename} changed, rebuilding..."
buildAndTest no, harmony
task 'build', 'build the CoffeeScript compiler from source', build
task 'build:parser', 'build the Jison parser only', buildParser
task 'build:except-parser', 'build the CoffeeScript compiler, except for the Jison parser', buildExceptParser
task 'build:full', 'build the CoffeeScript compiler from source twice, and run the tests', ->
build ->
build testBuiltCode
task 'build:browser', 'merge the built scripts into a single file for use in a browser', ->
code = """
require['../../package.json'] = (function() {
return #{fs.readFileSync "./package.json"};
})();
"""
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffeescript', 'browser']
code += """
require['./#{name}'] = (function() {
var exports = {}, module = {exports: exports};
#{fs.readFileSync "lib/coffeescript/#{name}.js"}
return module.exports;
})();
"""
# From here, we generate two outputs: a legacy script output for all browsers
# and a module output for browsers that support `<script type="module">`.
code = """
var CoffeeScript = function() {
function require(path){ return require[path]; }
#{code}
return require['./browser'];
}();
"""
scriptCode = transpile """
(function(root) {
#{code}
if (typeof define === 'function' && define.amd) {
define(function() { return CoffeeScript; });
} else {
root.CoffeeScript = CoffeeScript;
}
}(this));
"""
moduleCode = transpile """
#{code}
export default CoffeeScript;
const { VERSION, compile, eval: evaluate, load, run, runScripts } = CoffeeScript;
export { VERSION, compile, evaluate as eval, load, run, runScripts };
""", {sourceType: 'module'}
outputFolders = [
"docs/v#{majorVersion}/browser-compiler-legacy"
"docs/v#{majorVersion}/browser-compiler-modern"
"lib/coffeescript-browser-compiler-legacy"
"lib/coffeescript-browser-compiler-modern"
]
for outputFolder in outputFolders
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
fs.writeFileSync "#{outputFolder}/coffeescript.js", """
#{header}
#{if outputFolder.includes('legacy') then scriptCode else moduleCode}
"""
task 'build:browser:full', 'merge the built scripts into a single file for use in a browser, and test it', ->
invoke 'build:browser'
console.log "built ... running browser tests:"
invoke 'test:browser'
task 'build:watch', 'watch and continually rebuild the CoffeeScript compiler, running tests on each build', ->
watchAndBuildAndTest()
task 'build:watch:harmony', 'watch and continually rebuild the CoffeeScript compiler, running harmony tests on each build', ->
watchAndBuildAndTest yes
buildDocs = (watch = no) ->
# Constants
indexFile = 'documentation/site/index.html'
siteSourceFolder = "documentation/site"
sectionsSourceFolder = 'documentation/sections'
changelogSourceFolder = 'documentation/sections/changelog'
examplesSourceFolder = 'documentation/examples'
outputFolder = "docs/v#{majorVersion}"
# Helpers
releaseHeader = (date, version, prevVersion) ->
"""
<h3>#{prevVersion and "<a href=\"https://github.com/jashkenas/coffeescript/compare/#{prevVersion}...#{version}\">#{version}</a>" or version}
<span class="timestamp"> — <time datetime="#{date}">#{date}</time></span>
</h3>
"""
codeFor = require "./documentation/site/code.coffee"
htmlFor = ->
hljs = require 'highlight.js'
hljs.configure classPrefix: ''
markdownRenderer = require('markdown-it')
html: yes
typographer: yes
highlight: (str, language) ->
# From https://github.com/markdown-it/markdown-it#syntax-highlighting
if language and hljs.getLanguage(language)
try
return hljs.highlight(str, { language }).value
catch ex
return '' # No syntax highlighting
# Add some custom overrides to Markdown-It’s rendering, per
# https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer
defaultFence = markdownRenderer.renderer.rules.fence
markdownRenderer.renderer.rules.fence = (tokens, idx, options, env, slf) ->
code = tokens[idx].content
if code.indexOf('codeFor(') is 0 or code.indexOf('releaseHeader(') is 0
"<%= #{code} %>"
else
"<blockquote class=\"uneditable-code-block\">#{defaultFence.apply @, arguments}</blockquote>"
(file, bookmark) ->
md = fs.readFileSync "#{sectionsSourceFolder}/#{file.replace /\//g, path.sep}.md", 'utf-8'
md = md.replace /<%= releaseHeader %>/g, releaseHeader
md = md.replace /<%= majorVersion %>/g, majorVersion
md = md.replace /<%= fullVersion %>/g, CoffeeScript.VERSION
html = markdownRenderer.render md
html = _.template(html)
codeFor: codeFor()
releaseHeader: releaseHeader
includeScript = ->
(file) ->
file = "#{siteSourceFolder}/#{file}" unless '/' in file
code = fs.readFileSync file, 'utf-8'
code = CoffeeScript.compile code
code = transpile code
code
include = ->
(file) ->
file = "#{siteSourceFolder}/#{file}" unless '/' in file
output = fs.readFileSync file, 'utf-8'
if /\.html$/.test(file)
render = _.template output
output = render
releaseHeader: releaseHeader
majorVersion: majorVersion
fullVersion: CoffeeScript.VERSION
htmlFor: htmlFor()
codeFor: codeFor()
include: include()
includeScript: includeScript()
output
# Task
do renderIndex = ->
render = _.template fs.readFileSync(indexFile, 'utf-8')
output = render
include: include()
fs.writeFileSync "#{outputFolder}/index.html", output
log 'compiled', green, "#{indexFile} → #{outputFolder}/index.html"
try
fs.symlinkSync "v#{majorVersion}/index.html", 'docs/index.html'
catch exception
if watch
for target in [indexFile, siteSourceFolder, examplesSourceFolder, sectionsSourceFolder, changelogSourceFolder]
fs.watch target, interval: 200, renderIndex
log 'watching...', green
task 'doc:site', 'build the documentation for the website', ->
buildDocs()
task 'doc:site:watch', 'watch and continually rebuild the documentation for the website', ->
buildDocs yes
buildDocTests = (watch = no) ->
# Constants
testFile = 'documentation/site/test.html'
testsSourceFolder = 'test'
outputFolder = "docs/v#{majorVersion}"
# Included in test.html
testHelpers = fs.readFileSync('test/support/helpers.coffee', 'utf-8').replace /exports\./g, '@'
# Helpers
testsInScriptBlocks = ->
output = ''
for filename in fs.readdirSync(testsSourceFolder).sort()
if filename.indexOf('.coffee') isnt -1
type = 'coffeescript'
else if filename.indexOf('.litcoffee') isnt -1
type = 'literate-coffeescript'
else
continue
# Set the type to text/x-coffeescript or text/x-literate-coffeescript
# to prevent the browser compiler from automatically running the script
output += """
<script type="text/x-#{type}" class="test" id="#{filename.split('.')[0]}">
#{fs.readFileSync "test/#{filename}", 'utf-8'}
</script>\n
"""
output
# Task
do renderTest = ->
render = _.template fs.readFileSync(testFile, 'utf-8')
output = render
testHelpers: testHelpers
tests: testsInScriptBlocks()
fs.writeFileSync "#{outputFolder}/test.html", output
log 'compiled', green, "#{testFile} → #{outputFolder}/test.html"
if watch
for target in [testFile, testsSourceFolder]
fs.watch target, interval: 200, renderTest
log 'watching...', green
task 'doc:test', 'build the browser-based tests', ->
buildDocTests()
task 'doc:test:watch', 'watch and continually rebuild the browser-based tests', ->
buildDocTests yes
buildAnnotatedSource = (watch = no) ->
do generateAnnotatedSource = ->
exec "cd src && ../node_modules/docco/bin/docco *.*coffee --output ../docs/v#{majorVersion}/annotated-source", (err) -> throw err if err
log 'generated', green, "annotated source in docs/v#{majorVersion}/annotated-source/"
if watch
fs.watch 'src/', interval: 200, generateAnnotatedSource
log 'watching...', green
task 'doc:source', 'build the annotated source documentation', ->
buildAnnotatedSource()
task 'doc:source:watch', 'watch and continually rebuild the annotated source documentation', ->
buildAnnotatedSource yes
task 'release', 'update dependencies, build and test the CoffeeScript source, and build the documentation', ->
execSync '''
npm install --silent
cake build:full
cake build:browser
cake doc:test
cake test:browser:node
cake test:browser
cake test:integrations
cake doc:site
cake doc:source
''', stdio: 'inherit'
task 'bench', 'quick benchmark of compilation time', ->
{Rewriter} = require './lib/coffeescript/rewriter'
sources = ['coffeescript', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n'
litcoffee = fs.readFileSync("src/scope.litcoffee").toString()
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
total = 0
now = Date.now()
time = -> total += ms = -(now - now = Date.now()); fmt ms
tokens = CoffeeScript.tokens coffee, rewrite: no
littokens = CoffeeScript.tokens litcoffee, rewrite: no, literate: yes
tokens = tokens.concat(littokens)
console.log "Lex #{time()} (#{tokens.length} tokens)"
tokens = new Rewriter().rewrite tokens
console.log "Rewrite#{time()} (#{tokens.length} tokens)"
nodes = CoffeeScript.nodes tokens
console.log "Parse #{time()}"
js = nodes.compile bare: yes
console.log "Compile#{time()} (#{js.length} chars)"
console.log "total #{ fmt total }"
# Run the CoffeeScript test suite.
runTests = (CoffeeScript) ->
CoffeeScript.register() unless global.testingBrowser
# These are attached to `global` so that they’re accessible from within
# `test/async.coffee`, which has an async-capable version of
# `global.test`.
global.currentFile = null
global.passedTests = 0
global.failures = []
global[name] = func for name, func of require 'assert'
# Convenience aliases.
global.CoffeeScript = CoffeeScript
global.Repl = require './lib/coffeescript/repl'
global.bold = bold
global.red = red
global.green = green
global.yellow = yellow
global.reset = reset
asyncTests = []
onFail = (description, fn, err) ->
failures.push
filename: global.currentFile
error: err
description: description
source: fn.toString() if fn.toString?
# Our test helper function for delimiting different test cases.
global.test = (description, fn) ->
try
fn.test = {description, currentFile}
result = fn.call(fn)
if result instanceof Promise # An async test.
asyncTests.push result
result.then ->
passedTests++
.catch (err) ->
onFail description, fn, err
else
passedTests++
catch err
onFail description, fn, err
helpers.extend global, require './test/support/helpers'
# When all the tests have run, collect and print errors.
# If a stacktrace is available, output the compiled function source.
process.on 'exit', ->
time = ((Date.now() - startTime) / 1000).toFixed(2)
message = "passed #{passedTests} tests in #{time} seconds#{reset}"
return log(message, green) unless failures.length
log "failed #{failures.length} and #{message}", red
for fail in failures
{error, filename, description, source} = fail
console.log ''
log " #{description}", red if description
log " #{error.stack}", red
console.log " #{source}" if source
return
# Run every test in the `test` folder, recording failures, except for files
# we’re skipping because the features to be tested are unsupported in the
# current Node runtime.
testFilesToSkip = []
skipUnless = (featureDetect, filenames) ->
unless (try new Function featureDetect)
testFilesToSkip = testFilesToSkip.concat filenames
skipUnless 'async () => {}', ['async.coffee', 'async_iterators.coffee']
skipUnless 'async function* generator() { yield 42; }', ['async_iterators.coffee']
skipUnless 'var a = 2 ** 2; a **= 3', ['exponentiation.coffee']
skipUnless 'var {...a} = {}', ['object_rest_spread.coffee']
skipUnless '/foo.bar/s.test("foo\tbar")', ['regex_dotall.coffee']
skipUnless '1_2_3', ['numeric_literal_separators.coffee']
skipUnless '1n', ['numbers_bigint.coffee']
skipUnless 'async () => { await import(\'data:application/json,{"foo":"bar"}\', { assert: { type: "json" } }) }', ['import_assertions.coffee']
files = fs.readdirSync('test').filter (filename) ->
filename not in testFilesToSkip
startTime = Date.now()
for file in files when helpers.isCoffee file
literate = helpers.isLiterate file
currentFile = filename = path.join 'test', file
code = fs.readFileSync filename
try
CoffeeScript.run code.toString(), {filename, literate}
catch error
failures.push {filename, error}
Promise.all(asyncTests).then ->
Promise.reject() if failures.length isnt 0
task 'test', 'run the CoffeeScript language test suite', ->
runTests(CoffeeScript).catch -> process.exit 1
task 'test:browser', 'run the test suite against the modern browser compiler in a headless browser', ->
# Create very simple web server to serve the two files we need.
http = require 'http'
serveFile = (res, fileToServe, mimeType) ->
res.statusCode = 200
res.setHeader 'Content-Type', mimeType
fs.createReadStream(fileToServe).pipe res
server = http.createServer (req, res) ->
if req.url is '/'
serveFile res, path.join(__dirname, 'docs', "v#{majorVersion}", 'test.html'), 'text/html'
else if req.url is '/browser-compiler-modern/coffeescript.js'
# The `text/javascript` MIME type is required for an ES module file to be
# loaded in a browser.
serveFile res, path.join(__dirname, 'docs', "v#{majorVersion}", 'browser-compiler-modern', 'coffeescript.js'), 'text/javascript'
else
res.statusCode = 404
res.end()
server.listen 8080, ->
puppeteer = require 'puppeteer'
browser = await puppeteer.launch()
page = await browser.newPage()
result = ""
try
await page.goto 'http://localhost:8080/'
element = await page.waitForSelector '#result',
visible: yes
polling: 'mutation'
timeout: 60000
result = await page.evaluate ((el) => el.textContent), element
catch e
log e, red
finally
try browser.close()
server.close()
if result and not result.includes('failed')
log result, green
else
log result, red
process.exit 1
task 'test:browser:node', 'run the test suite against the legacy browser compiler in Node', ->
source = fs.readFileSync "lib/coffeescript-browser-compiler-legacy/coffeescript.js", 'utf-8'
result = {}
global.testingBrowser = yes
(-> eval source).call result
runTests(CoffeeScript).catch -> process.exit 1
task 'test:integrations', 'test the module integrated with other libraries and environments', ->
# Tools like Webpack and Browserify generate builds intended for a browser
# environment where Node modules are not available. We want to ensure that
# the CoffeeScript module as presented by the `browser` key in `package.json`
# can be built by such tools; if such a build succeeds, it verifies that no
# Node modules are required as part of the compiler (as opposed to the tests)
# and that therefore the compiler will run in a browser environment.
# Webpack 5 requires Node >= 10.13.0.
[major, minor] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
return if major < 10 or (major is 10 and minor < 13)
tmpdir = os.tmpdir()
webpack = require 'webpack'
webpack {
entry: './'
optimization:
# Webpack’s minification causes the CoffeeScript module to fail some tests.
minimize: off
output:
path: tmpdir
filename: 'coffeescript.js'
library: 'CoffeeScript'
libraryTarget: 'commonjs2'
}, (err, stats) ->
if err or stats.hasErrors()
if err
console.error err.stack or err
console.error err.details if err.details
if stats.hasErrors()
console.error error for error in stats.compilation.errors
if stats.hasWarnings()
console.warn warning for warning in stats.compilation.warnings
process.exit 1
builtCompiler = path.join tmpdir, 'coffeescript.js'
{ CoffeeScript } = require builtCompiler
global.testingBrowser = yes
testResults = runTests CoffeeScript
fs.unlinkSync builtCompiler
process.exit 1 unless testResults
================================================
FILE: ISSUE_TEMPLATE.md
================================================
<!---
Thanks for filing an issue 😄! Before you submit, please read the following:
Search open/closed issues before submitting since someone might have asked the same thing before!
Our issues history stretches back to 2009, so the odds are good that your topic has come up.
If you have a support request or question please use Stack Overflow:
https://stackoverflow.com/questions/tagged/coffeescript
Issues on GitHub are only related to problems of the CoffeeScript compiler itself and we cannot answer
support questions here.
-->
Choose one: is this a bug report or feature request?
<!---
Provide a general summary of the issue in the title above.
For bugs, please also preface your title with “Bug:”. For feature requests, please preface your title
with “Proposal:”. Once your issue is reviewed, a maintainer will edit the title to refer to the part
of the codebase most relevant to the issue (if applicable).
If your request is that CoffeeScript support a new feature recently arrived to JavaScript, please note
that we generally only add features that have reached Stage 4 in the specification (in other words,
the syntax is finalized and the feature is approved to be part of the next ES release). You can still
open an issue, but it will likely be tagged with “[Awaiting Stage 4]” until the relevant ES feature is
approved for release. See https://coffeescript.org/#contributing
There are also a handful of JavaScript features that CoffeeScript intentionally does not support.
Please do not open issues regarding these. They’re listed in https://coffeescript.org/#unsupported
-->
### Input Code
<!--- If you're describing a bug, please let us know which sample code reproduces your problem. -->
<!--- If you have link from https://coffeescript.org/#try or a standalone repo please include that! -->
```coffee
your (code) => here
```
### Expected Behavior
<!--- If you’re describing a bug, tell us what should happen. -->
<!--- If you’re suggesting a change/improvement, tell us how it should work. -->
### Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior. -->
<!--- If suggesting a change/improvement, explain the difference from current behavior. -->
### Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change. -->
### Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world. -->
### Environment
<!--- For bugs, please let us know what version of CoffeeScript you’re running: `coffee -v`. -->
<!--- If you think it might be relevant, please also let us know your version of Node. -->
* CoffeeScript version:
* Node.js version:
================================================
FILE: LICENSE
================================================
Copyright (c) 2009-2018 Jeremy Ashkenas
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: PULL_REQUEST_TEMPLATE.md
================================================
<!--
Before making a PR please make sure to read our contributing guidelines:
https://coffeescript.org/#contributing
For issue references: Add a comma-separated list of a
[closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by
the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
All new features require tests. All but the most trivial bug fixes should also have new or updated tests.
Ensure that all new code you add to the compiler can be run in the minimum version of Node listed in
`package.json`. New tests can require newer Node runtimes, but you may need to ensure that such tests
only run in supported runtimes; see `Cakefile` for examples of how to filter out certain tests in
runtimes that don’t support them.
Please follow the code style of the rest of the CoffeeScript codebase. Write comments in complete
sentences using Markdown, as the comments become the [annotated source](https://coffeescript.org/#annotated-source).
For tests proving a bug is fixed, please mention the issue number in the test description (see examples
in the codebase).
Describe your changes below in as much detail as possible.
-->
================================================
FILE: README.md
================================================
```
@@@@@@@ @@@@ @@@@@
@@@@@@@@@@ @@@ @@@ {
@@@@ @@ @@@ @@@ } } {
@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@@@@ { { } }
@@@@ @@@ @@ @@@@@ @@@@@@ @@@ @@ @@@@ @@ } }{ {
@@@@ @@@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ { }{ } }
@@@@ @@@@ @@ @@@ @@@ @@@@@@@@ @@@@@@@@ { }{ }{ { }
@@@@@ @@@@ @@ @@@ @@@ @@@ @@@ { { } { } { } }
@@@@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ { } { } { }
@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@@ { } { } @@@@@@@
@@@ @@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@ @@@ @@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ @@ @@@ @@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@
@@@@ @@@ @@ @@@@ @@@ @@@@@@@@@@@@@@@@@@@@@
@@@@@ @@@@@ @@ @@ @@@ @@@@@@@ @@@@@ @@@ @@@@@@@@@@@@@@@@@@
@@@@@ @@@ @@@ @@@@@@@@ @@@@ @@@@ @@@@@@@ @@@ @@@@@@@@@@@@@@@@
@@@@@ @@@ @@@@ @@@@ @@@ @@@ @@@ @@@@@@@@@@@@@@
@@@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@
@@@ @@@@ @@@ @@@@ @@@@ @@@ @@@@ @@@@
@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@
@@@@@@@@@ @@@@@@ @@@@ @@@@ @@@@@@@@@ @@@@
@@@ @@@@
@@@
@@@
```
CoffeeScript is a little language that compiles into JavaScript.
## Installation
Once you have Node.js installed:
```shell
# Install locally for a project:
npm install --save-dev coffeescript
# Install globally to execute .coffee files anywhere:
npm install --global coffeescript
```
## Getting Started
Execute a script:
```shell
coffee /path/to/script.coffee
```
Compile a script:
```shell
coffee -c /path/to/script.coffee
```
For documentation, usage, and examples, see: https://coffeescript.org/
To suggest a feature or report a bug: https://github.com/jashkenas/coffeescript/issues
If you’d like to chat, drop by #coffeescript on Freenode IRC.
The source repository: https://github.com/jashkenas/coffeescript.git
Changelog: https://coffeescript.org/#changelog
Our lovely and talented contributors are listed here: https://github.com/jashkenas/coffeescript/contributors
================================================
FILE: bin/cake
================================================
#!/usr/bin/env node
try {
new Function('var {a} = {a: 1}')();
} catch (error) {
console.error('Your JavaScript runtime does not support some features used by the cake command. Please use Node 6 or later.');
process.exit(1);
}
var path = require('path');
var fs = require('fs');
var potentialPaths = [
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
path.join(__dirname, '../lib/coffeescript')
];
for (var i = 0, len = potentialPaths.length; i < len; i++) {
if (fs.existsSync(potentialPaths[i])) {
require(potentialPaths[i] + '/cake').run();
break;
}
}
================================================
FILE: bin/coffee
================================================
#!/usr/bin/env node
try {
new Function('var {a} = {a: 1}')();
} catch (error) {
console.error('Your JavaScript runtime does not support some features used by the coffee command. Please use Node 6 or later.');
process.exit(1);
}
var path = require('path');
var fs = require('fs');
var potentialPaths = [
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
path.join(__dirname, '../lib/coffeescript')
];
for (var i = 0, len = potentialPaths.length; i < len; i++) {
if (fs.existsSync(potentialPaths[i])) {
require(potentialPaths[i] + '/command').run();
break;
}
}
================================================
FILE: bower.json
================================================
{
"name": "coffeescript",
"main": [
"lib/coffeescript/browser.js"
],
"description": "Unfancy JavaScript",
"keywords": [
"javascript",
"language",
"coffeescript",
"compiler"
],
"author": {
"name": "Jeremy Ashkenas"
},
"ignore": [
"test"
]
}
================================================
FILE: docs/CNAME
================================================
coffeescript.org
================================================
FILE: docs/browserconfig.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
================================================
FILE: docs/manifest.json
================================================
{
"name": "CoffeeScript",
"description": "Unfancy JavaScript",
"icons": [
{
"src": "\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png"
},
{
"src": "\/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image\/png"
}
],
"theme_color": "#ffffff",
"display": "standalone"
}
================================================
FILE: docs/v1/annotated-source/browser.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>browser.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="browser.html">
browser.coffee
</a>
<a class="source" href="cake.html">
cake.coffee
</a>
<a class="source" href="coffee-script.html">
coffee-script.coffee
</a>
<a class="source" href="command.html">
command.coffee
</a>
<a class="source" href="grammar.html">
grammar.coffee
</a>
<a class="source" href="helpers.html">
helpers.coffee
</a>
<a class="source" href="index.html">
index.coffee
</a>
<a class="source" href="lexer.html">
lexer.coffee
</a>
<a class="source" href="nodes.html">
nodes.coffee
</a>
<a class="source" href="optparse.html">
optparse.coffee
</a>
<a class="source" href="register.html">
register.coffee
</a>
<a class="source" href="repl.html">
repl.coffee
</a>
<a class="source" href="rewriter.html">
rewriter.coffee
</a>
<a class="source" href="scope.html">
scope.litcoffee
</a>
<a class="source" href="sourcemap.html">
sourcemap.litcoffee
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>browser.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<p>This <strong>Browser</strong> compatibility layer extends core CoffeeScript functions
to make things work smoothly when compiling code directly in the browser.
We add support for loading remote Coffee scripts via <strong>XHR</strong>, and
<code>text/coffeescript</code> script tags, source maps via data-URLs, and so on.</p>
</div>
<div class="content"><div class='highlight'><pre>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span>
CoffeeScript.<span class="hljs-built_in">require</span> = <span class="hljs-built_in">require</span>
compile = CoffeeScript.compile</pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>Use standard JavaScript <code>eval</code> to eval code.</p>
</div>
<div class="content"><div class='highlight'><pre>CoffeeScript.eval = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
options.bare ?= <span class="hljs-literal">on</span>
eval compile code, options</pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>Running code does not provide access to this scope.</p>
</div>
<div class="content"><div class='highlight'><pre>CoffeeScript.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
options.bare = <span class="hljs-literal">on</span>
options.shiftLine = <span class="hljs-literal">on</span>
Function(compile code, options)()</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
<p>If we’re not in a browser environment, we’re finished with the public API.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> <span class="hljs-built_in">window</span>?</pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>Include source maps where possible. If we’ve got a base64 encoder, a
JSON serializer, and tools for escaping unicode characters, we’re good to go.
Ported from <a href="https://developer.mozilla.org/en-US/docs/DOM/window.btoa">https://developer.mozilla.org/en-US/docs/DOM/window.btoa</a></p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> btoa? <span class="hljs-keyword">and</span> JSON?
<span class="hljs-function"> <span class="hljs-title">compile</span> = <span class="hljs-params">(code, options = {})</span> -></span>
options.inlineMap = <span class="hljs-literal">true</span>
CoffeeScript.compile code, options</pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>Load a remote script from the current domain via XHR.</p>
</div>
<div class="content"><div class='highlight'><pre>CoffeeScript.load = <span class="hljs-function"><span class="hljs-params">(url, callback, options = {}, hold = <span class="hljs-literal">false</span>)</span> -></span>
options.sourceFiles = [url]
xhr = <span class="hljs-keyword">if</span> <span class="hljs-built_in">window</span>.ActiveXObject
<span class="hljs-keyword">new</span> <span class="hljs-built_in">window</span>.ActiveXObject(<span class="hljs-string">'Microsoft.XMLHTTP'</span>)
<span class="hljs-keyword">else</span>
<span class="hljs-keyword">new</span> <span class="hljs-built_in">window</span>.XMLHttpRequest()
xhr.open <span class="hljs-string">'GET'</span>, url, <span class="hljs-literal">true</span>
xhr.overrideMimeType <span class="hljs-string">'text/plain'</span> <span class="hljs-keyword">if</span> <span class="hljs-string">'overrideMimeType'</span> <span class="hljs-keyword">of</span> xhr
xhr.onreadystatechange = <span class="hljs-function">-></span>
<span class="hljs-keyword">if</span> xhr.readyState <span class="hljs-keyword">is</span> <span class="hljs-number">4</span>
<span class="hljs-keyword">if</span> xhr.status <span class="hljs-keyword">in</span> [<span class="hljs-number">0</span>, <span class="hljs-number">200</span>]
param = [xhr.responseText, options]
CoffeeScript.run param... <span class="hljs-keyword">unless</span> hold
<span class="hljs-keyword">else</span>
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Could not load <span class="hljs-subst">#{url}</span>"</span>
callback param <span class="hljs-keyword">if</span> callback
xhr.send <span class="hljs-literal">null</span></pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>Activate CoffeeScript in the browser by having it compile and evaluate
all script tags with a content-type of <code>text/coffeescript</code>.
This happens on page load.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">runScripts</span> = -></span>
scripts = <span class="hljs-built_in">window</span>.<span class="hljs-built_in">document</span>.getElementsByTagName <span class="hljs-string">'script'</span>
coffeetypes = [<span class="hljs-string">'text/coffeescript'</span>, <span class="hljs-string">'text/literate-coffeescript'</span>]
coffees = (s <span class="hljs-keyword">for</span> s <span class="hljs-keyword">in</span> scripts <span class="hljs-keyword">when</span> s.type <span class="hljs-keyword">in</span> coffeetypes)
index = <span class="hljs-number">0</span>
<span class="hljs-function">
<span class="hljs-title">execute</span> = -></span>
param = coffees[index]
<span class="hljs-keyword">if</span> param <span class="hljs-keyword">instanceof</span> Array
CoffeeScript.run param...
index++
execute()
<span class="hljs-keyword">for</span> script, i <span class="hljs-keyword">in</span> coffees
<span class="hljs-keyword">do</span> (script, i) ->
options = literate: script.type <span class="hljs-keyword">is</span> coffeetypes[<span class="hljs-number">1</span>]
source = script.src <span class="hljs-keyword">or</span> script.getAttribute(<span class="hljs-string">'data-src'</span>)
<span class="hljs-keyword">if</span> source
CoffeeScript.load source,
<span class="hljs-function"><span class="hljs-params">(param)</span> -></span>
coffees[i] = param
execute()
options
<span class="hljs-literal">true</span>
<span class="hljs-keyword">else</span>
options.sourceFiles = [<span class="hljs-string">'embedded'</span>]
coffees[i] = [script.innerHTML, options]
execute()</pre></div></div>
</li>
<li id="section-8">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">¶</a>
</div>
<p>Listen for window load, both in decent browsers and in IE.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">window</span>.addEventListener
<span class="hljs-built_in">window</span>.addEventListener <span class="hljs-string">'DOMContentLoaded'</span>, runScripts, <span class="hljs-literal">no</span>
<span class="hljs-keyword">else</span>
<span class="hljs-built_in">window</span>.attachEvent <span class="hljs-string">'onload'</span>, runScripts</pre></div></div>
</li>
</ul>
</div>
</body>
</html>
================================================
FILE: docs/v1/annotated-source/cake.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>cake.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="browser.html">
browser.coffee
</a>
<a class="source" href="cake.html">
cake.coffee
</a>
<a class="source" href="coffee-script.html">
coffee-script.coffee
</a>
<a class="source" href="command.html">
command.coffee
</a>
<a class="source" href="grammar.html">
grammar.coffee
</a>
<a class="source" href="helpers.html">
helpers.coffee
</a>
<a class="source" href="index.html">
index.coffee
</a>
<a class="source" href="lexer.html">
lexer.coffee
</a>
<a class="source" href="nodes.html">
nodes.coffee
</a>
<a class="source" href="optparse.html">
optparse.coffee
</a>
<a class="source" href="register.html">
register.coffee
</a>
<a class="source" href="repl.html">
repl.coffee
</a>
<a class="source" href="rewriter.html">
rewriter.coffee
</a>
<a class="source" href="scope.html">
scope.litcoffee
</a>
<a class="source" href="sourcemap.html">
sourcemap.litcoffee
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>cake.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a>
(<a href="http://rake.rubyforge.org/">Rake</a>, <a href="https://github.com/280north/jake">Jake</a>)
for CoffeeScript. You define tasks with names and descriptions in a Cakefile,
and can call them from the command line, or invoke them from other tasks.</p>
<p>Running <code>cake</code> with no arguments will print out a list of all the tasks in the
current directory’s Cakefile.</p>
</div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>External dependencies.</p>
</div>
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span></pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>Register .coffee extension</p>
</div>
<div class="content"><div class='highlight'><pre>CoffeeScript.register()</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
<p>Keep track of the list of defined tasks, the accepted options, and so on.</p>
</div>
<div class="content"><div class='highlight'><pre>tasks = {}
options = {}
switches = []
oparse = <span class="hljs-literal">null</span></pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>Mixin the top-level Cake functions for Cakefiles to use directly.</p>
</div>
<div class="content"><div class='highlight'><pre>helpers.extend <span class="hljs-built_in">global</span>,</pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>Define a Cake task with a short name, an optional sentence description,
and the function to run as the action itself.</p>
</div>
<div class="content"><div class='highlight'><pre> task: <span class="hljs-function"><span class="hljs-params">(name, description, action)</span> -></span>
[action, description] = [description, action] <span class="hljs-keyword">unless</span> action
tasks[name] = {name, description, action}</pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>Define an option that the Cakefile accepts. The parsed options hash,
containing all of the command-line options passed, will be made available
as the first argument to the action.</p>
</div>
<div class="content"><div class='highlight'><pre> option: <span class="hljs-function"><span class="hljs-params">(letter, flag, description)</span> -></span>
switches.push [letter, flag, description]</pre></div></div>
</li>
<li id="section-8">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">¶</a>
</div>
<p>Invoke another task in the current Cakefile.</p>
</div>
<div class="content"><div class='highlight'><pre> invoke: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
missingTask name <span class="hljs-keyword">unless</span> tasks[name]
tasks[name].action options</pre></div></div>
</li>
<li id="section-9">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-9">¶</a>
</div>
<p>Run <code>cake</code>. Executes all of the tasks you pass, in order. Note that Node’s
asynchrony may cause tasks to execute in a different order than you’d expect.
If no tasks are passed, print the help screen. Keep a reference to the
original directory name, when running Cake tasks from subdirectories.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function">-></span>
<span class="hljs-built_in">global</span>.__originalDirname = fs.realpathSync <span class="hljs-string">'.'</span>
process.chdir cakefileDirectory __originalDirname
args = process.argv[<span class="hljs-number">2.</span>.]
CoffeeScript.run fs.readFileSync(<span class="hljs-string">'Cakefile'</span>).toString(), filename: <span class="hljs-string">'Cakefile'</span>
oparse = <span class="hljs-keyword">new</span> optparse.OptionParser switches
<span class="hljs-keyword">return</span> printTasks() <span class="hljs-keyword">unless</span> args.length
<span class="hljs-keyword">try</span>
options = oparse.parse(args)
<span class="hljs-keyword">catch</span> e
<span class="hljs-keyword">return</span> fatalError <span class="hljs-string">"<span class="hljs-subst">#{e}</span>"</span>
invoke arg <span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> options.arguments</pre></div></div>
</li>
<li id="section-10">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-10">¶</a>
</div>
<p>Display the list of Cake tasks in a format similar to <code>rake -T</code></p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">printTasks</span> = -></span>
relative = path.relative <span class="hljs-keyword">or</span> path.resolve
cakefilePath = path.join relative(__originalDirname, process.cwd()), <span class="hljs-string">'Cakefile'</span>
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"<span class="hljs-subst">#{cakefilePath}</span> defines the following tasks:\n"</span>
<span class="hljs-keyword">for</span> name, task <span class="hljs-keyword">of</span> tasks
spaces = <span class="hljs-number">20</span> - name.length
spaces = <span class="hljs-keyword">if</span> spaces > <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> Array(spaces + <span class="hljs-number">1</span>).join(<span class="hljs-string">' '</span>) <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
desc = <span class="hljs-keyword">if</span> task.description <span class="hljs-keyword">then</span> <span class="hljs-string">"# <span class="hljs-subst">#{task.description}</span>"</span> <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"cake <span class="hljs-subst">#{name}</span><span class="hljs-subst">#{spaces}</span> <span class="hljs-subst">#{desc}</span>"</span>
<span class="hljs-built_in">console</span>.log oparse.help() <span class="hljs-keyword">if</span> switches.length</pre></div></div>
</li>
<li id="section-11">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">¶</a>
</div>
<p>Print an error and exit when attempting to use an invalid task/option.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">fatalError</span> = <span class="hljs-params">(message)</span> -></span>
<span class="hljs-built_in">console</span>.error message + <span class="hljs-string">'\n'</span>
<span class="hljs-built_in">console</span>.log <span class="hljs-string">'To see a list of all tasks/options, run "cake"'</span>
process.exit <span class="hljs-number">1</span>
<span class="hljs-function">
<span class="hljs-title">missingTask</span> = <span class="hljs-params">(task)</span> -></span> fatalError <span class="hljs-string">"No such task: <span class="hljs-subst">#{task}</span>"</span></pre></div></div>
</li>
<li id="section-12">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">¶</a>
</div>
<p>When <code>cake</code> is invoked, search in the current and all parent directories
to find the relevant Cakefile.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">cakefileDirectory</span> = <span class="hljs-params">(dir)</span> -></span>
<span class="hljs-keyword">return</span> dir <span class="hljs-keyword">if</span> fs.existsSync path.join dir, <span class="hljs-string">'Cakefile'</span>
parent = path.normalize path.join dir, <span class="hljs-string">'..'</span>
<span class="hljs-keyword">return</span> cakefileDirectory parent <span class="hljs-keyword">unless</span> parent <span class="hljs-keyword">is</span> dir
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"Cakefile not found in <span class="hljs-subst">#{process.cwd()}</span>"</span></pre></div></div>
</li>
</ul>
</div>
</body>
</html>
================================================
FILE: docs/v1/annotated-source/coffee-script.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>coffee-script.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="browser.html">
browser.coffee
</a>
<a class="source" href="cake.html">
cake.coffee
</a>
<a class="source" href="coffee-script.html">
coffee-script.coffee
</a>
<a class="source" href="command.html">
command.coffee
</a>
<a class="source" href="grammar.html">
grammar.coffee
</a>
<a class="source" href="helpers.html">
helpers.coffee
</a>
<a class="source" href="index.html">
index.coffee
</a>
<a class="source" href="lexer.html">
lexer.coffee
</a>
<a class="source" href="nodes.html">
nodes.coffee
</a>
<a class="source" href="optparse.html">
optparse.coffee
</a>
<a class="source" href="register.html">
register.coffee
</a>
<a class="source" href="repl.html">
repl.coffee
</a>
<a class="source" href="rewriter.html">
rewriter.coffee
</a>
<a class="source" href="scope.html">
scope.litcoffee
</a>
<a class="source" href="sourcemap.html">
sourcemap.litcoffee
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>coffee-script.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<p>CoffeeScript can be used both on the server, as a command-line compiler based
on Node.js/V8, or to run CoffeeScript directly in the browser. This module
contains the main entry functions for tokenizing, parsing, and compiling
source CoffeeScript into JavaScript.</p>
</div>
<div class="content"><div class='highlight'><pre>
fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
{Lexer} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./lexer'</span>
{parser} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./parser'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
SourceMap = <span class="hljs-built_in">require</span> <span class="hljs-string">'./sourcemap'</span></pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>Require <code>package.json</code>, which is two levels above this file, as this file is
evaluated from <code>lib/coffee-script</code>.</p>
</div>
<div class="content"><div class='highlight'><pre>packageJson = <span class="hljs-built_in">require</span> <span class="hljs-string">'../../package.json'</span></pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>The current CoffeeScript version number.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.VERSION = packageJson.version
exports.FILE_EXTENSIONS = [<span class="hljs-string">'.coffee'</span>, <span class="hljs-string">'.litcoffee'</span>, <span class="hljs-string">'.coffee.md'</span>]</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
<p>Expose helpers for testing.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.helpers = helpers</pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>Function that allows for btoa in both nodejs and the browser.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">base64encode</span> = <span class="hljs-params">(src)</span> -></span> <span class="hljs-keyword">switch</span>
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> Buffer <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span>
<span class="hljs-keyword">new</span> Buffer(src).toString(<span class="hljs-string">'base64'</span>)
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> btoa <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span></pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>The contents of a <code><script></code> block are encoded via UTF-16, so if any extended
characters are used in the block, btoa will fail as it maxes out at UTF-8.
See <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem">https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem</a>
for the gory details, and for the solution implemented here.</p>
</div>
<div class="content"><div class='highlight'><pre> btoa encodeURIComponent(src).replace <span class="hljs-regexp">/%([0-9A-F]{2})/g</span>, <span class="hljs-function"><span class="hljs-params">(match, p1)</span> -></span>
String.fromCharCode <span class="hljs-string">'0x'</span> + p1
<span class="hljs-keyword">else</span>
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error(<span class="hljs-string">'Unable to base64 encode inline sourcemap.'</span>)</pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>Function wrapper to add source file information to SyntaxErrors thrown by the
lexer/parser/compiler.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">withPrettyErrors</span> = <span class="hljs-params">(fn)</span> -></span>
(code, options = {}) ->
<span class="hljs-keyword">try</span>
fn.call @, code, options
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'string'</span> <span class="hljs-comment"># Support `CoffeeScript.nodes(tokens)`.</span>
<span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, code, options.filename</pre></div></div>
</li>
<li id="section-8">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">¶</a>
</div>
<p>For each compiled file, save its source in memory in case we need to
recompile it later. We might need to recompile if the first compilation
didn’t create a source map (faster) but something went wrong and we need
a stack trace. Assuming that most of the time, code isn’t throwing
exceptions, it’s probably more efficient to compile twice only when we
need a stack trace, rather than always generating a source map even when
it’s not likely to be used. Save in form of <code>filename</code>: <code>(source)</code></p>
</div>
<div class="content"><div class='highlight'><pre>sources = {}</pre></div></div>
</li>
<li id="section-9">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-9">¶</a>
</div>
<p>Also save source maps if generated, in form of <code>filename</code>: <code>(source map)</code>.</p>
</div>
<div class="content"><div class='highlight'><pre>sourceMaps = {}</pre></div></div>
</li>
<li id="section-10">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-10">¶</a>
</div>
<p>Compile CoffeeScript code to JavaScript, using the Coffee/Jison compiler.</p>
<p>If <code>options.sourceMap</code> is specified, then <code>options.filename</code> must also be
specified. All options that can be passed to <code>SourceMap#generate</code> may also
be passed here.</p>
<p>This returns a javascript string, unless <code>options.sourceMap</code> is passed,
in which case this returns a <code>{js, v3SourceMap, sourceMap}</code>
object, where sourceMap is a sourcemap.coffee#SourceMap object, handy for
doing programmatic lookups.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.compile = compile = withPrettyErrors (code, options) ->
{merge, extend} = helpers
options = extend {}, options</pre></div></div>
</li>
<li id="section-11">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">¶</a>
</div>
<p>Always generate a source map if no filename is passed in, since without a
a filename we have no way to retrieve this source later in the event that
we need to recompile it to get a source map for <code>prepareStackTrace</code>.</p>
</div>
<div class="content"><div class='highlight'><pre> generateSourceMap = options.sourceMap <span class="hljs-keyword">or</span> options.inlineMap <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> options.filename?
filename = options.filename <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>
sources[filename] = code
map = <span class="hljs-keyword">new</span> SourceMap <span class="hljs-keyword">if</span> generateSourceMap
tokens = lexer.tokenize code, options</pre></div></div>
</li>
<li id="section-12">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">¶</a>
</div>
<p>Pass a list of referenced variables, so that generated variables won’t get
the same name.</p>
</div>
<div class="content"><div class='highlight'><pre> options.referencedVars = (
token[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>
)</pre></div></div>
</li>
<li id="section-13">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-13">¶</a>
</div>
<p>Check for import or export; if found, force bare mode.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> options.bare? <span class="hljs-keyword">and</span> options.bare <span class="hljs-keyword">is</span> <span class="hljs-literal">yes</span>
<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens
<span class="hljs-keyword">if</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> [<span class="hljs-string">'IMPORT'</span>, <span class="hljs-string">'EXPORT'</span>]
options.bare = <span class="hljs-literal">yes</span>
<span class="hljs-keyword">break</span>
fragments = parser.parse(tokens).compileToFragments options
currentLine = <span class="hljs-number">0</span>
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.header
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.shiftLine
currentColumn = <span class="hljs-number">0</span>
js = <span class="hljs-string">""</span>
<span class="hljs-keyword">for</span> fragment <span class="hljs-keyword">in</span> fragments</pre></div></div>
</li>
<li id="section-14">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-14">¶</a>
</div>
<p>Update the sourcemap with data from each fragment.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> generateSourceMap</pre></div></div>
</li>
<li id="section-15">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-15">¶</a>
</div>
<p>Do not include empty, whitespace, or semicolon-only fragments.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> fragment.locationData <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> <span class="hljs-regexp">/^[;\s]*$/</span>.test fragment.code
map.add(
[fragment.locationData.first_line, fragment.locationData.first_column]
[currentLine, currentColumn]
{noReplace: <span class="hljs-literal">true</span>})
newLines = helpers.count fragment.code, <span class="hljs-string">"\n"</span>
currentLine += newLines
<span class="hljs-keyword">if</span> newLines
currentColumn = fragment.code.length - (fragment.code.lastIndexOf(<span class="hljs-string">"\n"</span>) + <span class="hljs-number">1</span>)
<span class="hljs-keyword">else</span>
currentColumn += fragment.code.length</pre></div></div>
</li>
<li id="section-16">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-16">¶</a>
</div>
<p>Copy the code from each fragment into the final JavaScript.</p>
</div>
<div class="content"><div class='highlight'><pre> js += fragment.code
<span class="hljs-keyword">if</span> options.header
header = <span class="hljs-string">"Generated by CoffeeScript <span class="hljs-subst">#{@VERSION}</span>"</span>
js = <span class="hljs-string">"// <span class="hljs-subst">#{header}</span>\n<span class="hljs-subst">#{js}</span>"</span>
<span class="hljs-keyword">if</span> generateSourceMap
v3SourceMap = map.generate(options, code)
sourceMaps[filename] = map
<span class="hljs-keyword">if</span> options.inlineMap
encoded = base64encode JSON.stringify v3SourceMap
sourceMapDataURI = <span class="hljs-string">"//# sourceMappingURL=data:application/json;base64,<span class="hljs-subst">#{encoded}</span>"</span>
sourceURL = <span class="hljs-string">"//# sourceURL=<span class="hljs-subst">#{options.filename ? <span class="hljs-string">'coffeescript'</span>}</span>"</span>
js = <span class="hljs-string">"<span class="hljs-subst">#{js}</span>\n<span class="hljs-subst">#{sourceMapDataURI}</span>\n<span class="hljs-subst">#{sourceURL}</span>"</span>
<span class="hljs-keyword">if</span> options.sourceMap
{
js
sourceMap: map
v3SourceMap: JSON.stringify v3SourceMap, <span class="hljs-literal">null</span>, <span class="hljs-number">2</span>
}
<span class="hljs-keyword">else</span>
js</pre></div></div>
</li>
<li id="section-17">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-17">¶</a>
</div>
<p>Tokenize a string of CoffeeScript code, and return the array of tokens.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.tokens = withPrettyErrors (code, options) ->
lexer.tokenize code, options</pre></div></div>
</li>
<li id="section-18">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-18">¶</a>
</div>
<p>Parse a string of CoffeeScript code or an array of lexed tokens, and
return the AST. You can then compile it by calling <code>.compile()</code> on the root,
or traverse it by using <code>.traverseChildren()</code> with a callback.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.nodes = withPrettyErrors (source, options) ->
<span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> source <span class="hljs-keyword">is</span> <span class="hljs-string">'string'</span>
parser.parse lexer.tokenize source, options
<span class="hljs-keyword">else</span>
parser.parse source</pre></div></div>
</li>
<li id="section-19">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-19">¶</a>
</div>
<p>Compile and execute a string of CoffeeScript (on the server), correctly
setting <code>__filename</code>, <code>__dirname</code>, and relative <code>require()</code>.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
mainModule = <span class="hljs-built_in">require</span>.main</pre></div></div>
</li>
<li id="section-20">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-20">¶</a>
</div>
<p>Set the filename.</p>
</div>
<div class="content"><div class='highlight'><pre> mainModule.filename = process.argv[<span class="hljs-number">1</span>] =
<span class="hljs-keyword">if</span> options.filename <span class="hljs-keyword">then</span> fs.realpathSync(options.filename) <span class="hljs-keyword">else</span> <span class="hljs-string">'<anonymous>'</span></pre></div></div>
</li>
<li id="section-21">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-21">¶</a>
</div>
<p>Clear the module cache.</p>
</div>
<div class="content"><div class='highlight'><pre> mainModule.moduleCache <span class="hljs-keyword">and</span>= {}</pre></div></div>
</li>
<li id="section-22">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-22">¶</a>
</div>
<p>Assign paths for node_modules loading</p>
</div>
<div class="content"><div class='highlight'><pre> dir = <span class="hljs-keyword">if</span> options.filename?
path.dirname fs.realpathSync options.filename
<span class="hljs-keyword">else</span>
fs.realpathSync <span class="hljs-string">'.'</span>
mainModule.paths = <span class="hljs-built_in">require</span>(<span class="hljs-string">'module'</span>)._nodeModulePaths dir</pre></div></div>
</li>
<li id="section-23">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-23">¶</a>
</div>
<p>Compile.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> helpers.isCoffee(mainModule.filename) <span class="hljs-keyword">or</span> <span class="hljs-built_in">require</span>.extensions
answer = compile code, options
code = answer.js ? answer
mainModule._compile code, mainModule.filename</pre></div></div>
</li>
<li id="section-24">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-24">¶</a>
</div>
<p>Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
The CoffeeScript REPL uses this to run the input.</p>
</div>
<div class="content"><div class='highlight'><pre>exports.eval = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> code = code.trim()
createContext = vm.Script.createContext ? vm.createContext
isContext = vm.isContext ? (ctx) ->
options.sandbox <span class="hljs-keyword">instanceof</span> createContext().constructor
<span class="hljs-keyword">if</span> createContext
<span class="hljs-keyword">if</span> options.sandbox?
<span class="hljs-keyword">if</span> isContext options.sandbox
sandbox = options.sandbox
<span class="hljs-keyword">else</span>
sandbox = createContext()
sandbox[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options.sandbox
sandbox.<span class="hljs-built_in">global</span> = sandbox.root = sandbox.GLOBAL = sandbox
<span class="hljs-keyword">else</span>
sandbox = <span class="hljs-built_in">global</span>
sandbox.__filename = options.filename || <span class="hljs-string">'eval'</span>
sandbox.__dirname = path.dirname sandbox.__filename</pre></div></div>
</li>
<li id="section-25">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-25">¶</a>
</div>
<p>define module/require only if they chose not to specify their own</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> sandbox <span class="hljs-keyword">isnt</span> <span class="hljs-built_in">global</span> <span class="hljs-keyword">or</span> sandbox.<span class="hljs-built_in">module</span> <span class="hljs-keyword">or</span> sandbox.<span class="hljs-built_in">require</span>
Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
sandbox.<span class="hljs-built_in">module</span> = _module = <span class="hljs-keyword">new</span> Module(options.modulename || <span class="hljs-string">'eval'</span>)
sandbox.<span class="hljs-built_in">require</span> = _require = <span class="hljs-function"><span class="hljs-params">(path)</span> -></span> Module._load path, _module, <span class="hljs-literal">true</span>
_module.filename = sandbox.__filename
<span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> Object.getOwnPropertyNames <span class="hljs-built_in">require</span> <span class="hljs-keyword">when</span> r <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">'paths'</span>, <span class="hljs-string">'arguments'</span>, <span class="hljs-string">'caller'</span>]
_require[r] = <span class="hljs-built_in">require</span>[r]</pre></div></div>
</li>
<li id="section-26">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-26">¶</a>
</div>
<p>use the same hack node currently uses for their own REPL</p>
</div>
<div class="content"><div class='highlight'><pre> _require.paths = _module.paths = Module._nodeModulePaths process.cwd()
_require.resolve = <span class="hljs-function"><span class="hljs-params">(request)</span> -></span> Module._resolveFilename request, _module
o = {}
o[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options
o.bare = <span class="hljs-literal">on</span> <span class="hljs-comment"># ensure return value</span>
js = compile code, o
<span class="hljs-keyword">if</span> sandbox <span class="hljs-keyword">is</span> <span class="hljs-built_in">global</span>
vm.runInThisContext js
<span class="hljs-keyword">else</span>
vm.runInContext js, sandbox
exports.register = <span class="hljs-function">-></span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./register'</span></pre></div></div>
</li>
<li id="section-27">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-27">¶</a>
</div>
<p>Throw error with deprecation warning when depending upon implicit <code>require.extensions</code> registration</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">require</span>.extensions
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> @FILE_EXTENSIONS <span class="hljs-keyword">then</span> <span class="hljs-keyword">do</span> (ext) ->
<span class="hljs-built_in">require</span>.extensions[ext] ?= <span class="hljs-function">-></span>
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"""
Use CoffeeScript.register() or require the coffee-script/register module to require <span class="hljs-subst">#{ext}</span> files.
"""</span>
exports._compileFile = <span class="hljs-function"><span class="hljs-params">(filename, sourceMap = <span class="hljs-literal">no</span>, inlineMap = <span class="hljs-literal">no</span>)</span> -></span>
raw = fs.readFileSync filename, <span class="hljs-string">'utf8'</span></pre></div></div>
</li>
<li id="section-28">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-28">¶</a>
</div>
<p>Strip the Unicode byte order mark, if this file begins with one.</p>
</div>
<div class="content"><div class='highlight'><pre> stripped = <span class="hljs-keyword">if</span> raw.charCodeAt(<span class="hljs-number">0</span>) <span class="hljs-keyword">is</span> <span class="hljs-number">0xFEFF</span> <span class="hljs-keyword">then</span> raw.substring <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> raw
<span class="hljs-keyword">try</span>
answer = compile stripped, {
filename, sourceMap, inlineMap
sourceFiles: [filename]
literate: helpers.isLiterate filename
}
<span class="hljs-keyword">catch</span> err</pre></div></div>
</li>
<li id="section-29">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-29">¶</a>
</div>
<p>As the filename and code of a dynamically loaded file will be different
from the original file compiled with CoffeeScript.run, add that
information to error so it can be pretty-printed later.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, stripped, filename
answer</pre></div></div>
</li>
<li id="section-30">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-30">¶</a>
</div>
<p>Instantiate a Lexer for our use here.</p>
</div>
<div class="content"><div class='highlight'><pre>lexer = <span class="hljs-keyword">new</span> Lexer</pre></div></div>
</li>
<li id="section-31">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-31">¶</a>
</div>
<p>The real Lexer produces a generic stream of tokens. This object provides a
thin wrapper around it, compatible with the Jison API. We can then pass it
directly as a “Jison lexer”.</p>
</div>
<div class="content"><div class='highlight'><pre>parser.lexer =
lex: <span class="hljs-function">-></span>
token = parser.tokens[@pos++]
<span class="hljs-keyword">if</span> token
[tag, @yytext, @yylloc] = token
parser.errorToken = token.origin <span class="hljs-keyword">or</span> token
@yylineno = @yylloc.first_line
<span class="hljs-keyword">else</span>
tag = <span class="hljs-string">''</span>
tag
setInput: <span class="hljs-function"><span class="hljs-params">(tokens)</span> -></span>
parser.tokens = tokens
@pos = <span class="hljs-number">0</span>
upcomingInput: <span class="hljs-function">-></span>
<span class="hljs-string">""</span></pre></div></div>
</li>
<li id="section-32">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-32">¶</a>
</div>
<p>Make all the AST nodes visible to the parser.</p>
</div>
<div class="content"><div class='highlight'><pre>parser.yy = <span class="hljs-built_in">require</span> <span class="hljs-string">'./nodes'</span></pre></div></div>
</li>
<li id="section-33">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-33">¶</a>
</div>
<p>Override Jison’s default error handling function.</p>
</div>
<div class="content"><div class='highlight'><pre>parser.yy.parseError = <span class="hljs-function"><span class="hljs-params">(message, {token})</span> -></span></pre></div></div>
</li>
<li id="section-34">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-34">¶</a>
</div>
<p>Disregard Jison’s message, it contains redundant line number information.
Disregard the token, we take its value directly from the lexer in case
the error is caused by a generated token which might refer to its origin.</p>
</div>
<div class="content"><div class='highlight'><pre> {errorToken, tokens} = parser
[errorTag, errorText, errorLoc] = errorToken
errorText = <span class="hljs-keyword">switch</span>
<span class="hljs-keyword">when</span> errorToken <span class="hljs-keyword">is</span> tokens[tokens.length - <span class="hljs-number">1</span>]
<span class="hljs-string">'end of input'</span>
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'INDENT'</span>, <span class="hljs-string">'OUTDENT'</span>]
<span class="hljs-string">'indentation'</span>
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'IDENTIFIER'</span>, <span class="hljs-string">'NUMBER'</span>, <span class="hljs-string">'INFINITY'</span>, <span class="hljs-string">'STRING'</span>, <span class="hljs-string">'STRING_START'</span>, <span class="hljs-string">'REGEX'</span>, <span class="hljs-string">'REGEX_START'</span>]
errorTag.replace(<span class="hljs-regexp">/_START$/</span>, <span class="hljs-string">''</span>).toLowerCase()
<span class="hljs-keyword">else</span>
helpers.nameWhitespaceCharacter errorText</pre></div></div>
</li>
<li id="section-35">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-35">¶</a>
</div>
<p>The second argument has a <code>loc</code> property, which should have the location
data for this token. Unfortunately, Jison seems to send an outdated <code>loc</code>
(from the previous token), so we take the location information directly
from the lexer.</p>
</div>
<div class="content"><div class='highlight'><pre> helpers.throwSyntaxError <span class="hljs-string">"unexpected <span class="hljs-subst">#{errorText}</span>"</span>, errorLoc</pre></div></div>
</li>
<li id="section-36">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-36">¶</a>
</div>
<p>Based on <a href="http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js">http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js</a>
Modified to handle sourceMap</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">formatSourcePosition</span> = <span class="hljs-params">(frame, getSourceMapping)</span> -></span>
filename = <span class="hljs-literal">undefined</span>
fileLocation = <span class="hljs-string">''</span>
<span class="hljs-keyword">if</span> frame.isNative()
fileLocation = <span class="hljs-string">"native"</span>
<span class="hljs-keyword">else</span>
<span class="hljs-keyword">if</span> frame.isEval()
filename = frame.getScriptNameOrSourceURL()
fileLocation = <span class="hljs-string">"<span class="hljs-subst">#{frame.getEvalOrigin()}</span>, "</span> <span class="hljs-keyword">unless</span> filename
<span class="hljs-keyword">else</span>
filename = frame.getFileName()
filename <span class="hljs-keyword">or</span>= <span class="hljs-string">"<anonymous>"</span>
line = frame.getLineNumber()
column = frame.getColumnNumber()</pre></div></div>
</li>
<li id="section-37">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-37">¶</a>
</div>
<p>Check for a sourceMap position</p>
</div>
<div class="content"><div class='highlight'><pre> source = getSourceMapping filename, line, column
fileLocation =
<span class="hljs-keyword">if</span> source
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">0</span>]}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">1</span>]}</span>"</span>
<span class="hljs-keyword">else</span>
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{line}</span>:<span class="hljs-subst">#{column}</span>"</span>
functionName = frame.getFunctionName()
isConstructor = frame.isConstructor()
isMethodCall = <span class="hljs-keyword">not</span> (frame.isToplevel() <span class="hljs-keyword">or</span> isConstructor)
<span class="hljs-keyword">if</span> isMethodCall
methodName = frame.getMethodName()
typeName = frame.getTypeName()
<span class="hljs-keyword">if</span> functionName
tp = <span class="hljs-keyword">as</span> = <span class="hljs-string">''</span>
<span class="hljs-keyword">if</span> typeName <span class="hljs-keyword">and</span> functionName.indexOf typeName
tp = <span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>."</span>
<span class="hljs-keyword">if</span> methodName <span class="hljs-keyword">and</span> functionName.indexOf(<span class="hljs-string">".<span class="hljs-subst">#{methodName}</span>"</span>) <span class="hljs-keyword">isnt</span> functionName.length - methodName.length - <span class="hljs-number">1</span>
<span class="hljs-keyword">as</span> = <span class="hljs-string">" [as <span class="hljs-subst">#{methodName}</span>]"</span>
<span class="hljs-string">"<span class="hljs-subst">#{tp}</span><span class="hljs-subst">#{functionName}</span><span class="hljs-subst">#{<span class="hljs-keyword">as</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
<span class="hljs-keyword">else</span>
<span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>.<span class="hljs-subst">#{methodName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> isConstructor
<span class="hljs-string">"new <span class="hljs-subst">#{functionName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> functionName
<span class="hljs-string">"<span class="hljs-subst">#{functionName}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
<span class="hljs-keyword">else</span>
fileLocation
<span class="hljs-function">
<span class="hljs-title">getSourceMap</span> = <span class="hljs-params">(filename)</span> -></span>
<span class="hljs-keyword">if</span> sourceMaps[filename]?
sourceMaps[filename]</pre></div></div>
</li>
<li id="section-38">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-38">¶</a>
</div>
<p>CoffeeScript compiled in a browser may get compiled with <code>options.filename</code>
of <code><anonymous></code>, but the browser may request the stack trace with the
filename of the script file.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> sourceMaps[<span class="hljs-string">'<anonymous>'</span>]?
sourceMaps[<span class="hljs-string">'<anonymous>'</span>]
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> sources[filename]?
answer = compile sources[filename],
filename: filename
sourceMap: <span class="hljs-literal">yes</span>
literate: helpers.isLiterate filename
answer.sourceMap
<span class="hljs-keyword">else</span>
<span class="hljs-literal">null</span></pre></div></div>
</li>
<li id="section-39">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-39">¶</a>
</div>
<p>Based on <a href="http://goo.gl/ZTx1p">michaelficarra/CoffeeScriptRedux</a>
NodeJS / V8 have no support for transforming positions in stack traces using
sourceMap, so we must monkey-patch Error to display CoffeeScript source
positions.</p>
</div>
<div class="content"><div class='highlight'><pre>Error.prepareStackTrace = <span class="hljs-function"><span class="hljs-params">(err, stack)</span> -></span>
<span class="hljs-function"> <span class="hljs-title">getSourceMapping</span> = <span class="hljs-params">(filename, line, column)</span> -></span>
sourceMap = getSourceMap filename
answer = sourceMap.sourceLocation [line - <span class="hljs-number">1</span>, column - <span class="hljs-number">1</span>] <span class="hljs-keyword">if</span> sourceMap?
<span class="hljs-keyword">if</span> answer? <span class="hljs-keyword">then</span> [answer[<span class="hljs-number">0</span>] + <span class="hljs-number">1</span>, answer[<span class="hljs-number">1</span>] + <span class="hljs-number">1</span>] <span class="hljs-keyword">else</span> <span class="hljs-literal">null</span>
frames = <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> stack
<span class="hljs-keyword">break</span> <span class="hljs-keyword">if</span> frame.getFunction() <span class="hljs-keyword">is</span> exports.run
<span class="hljs-string">" at <span class="hljs-subst">#{formatSourcePosition frame, getSourceMapping}</span>"</span>
<span class="hljs-string">"<span class="hljs-subst">#{err.toString()}</span>\n<span class="hljs-subst">#{frames.join <span class="hljs-string">'\n'</span>}</span>\n"</span></pre></div></div>
</li>
</ul>
</div>
</body>
</html>
================================================
FILE: docs/v1/annotated-source/command.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>command.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="browser.html">
browser.coffee
</a>
<a class="source" href="cake.html">
cake.coffee
</a>
<a class="source" href="coffee-script.html">
coffee-script.coffee
</a>
<a class="source" href="command.html">
command.coffee
</a>
<a class="source" href="grammar.html">
grammar.coffee
</a>
<a class="source" href="helpers.html">
helpers.coffee
</a>
<a class="source" href="index.html">
index.coffee
</a>
<a class="source" href="lexer.html">
lexer.coffee
</a>
<a class="source" href="nodes.html">
nodes.coffee
</a>
<a class="source" href="optparse.html">
optparse.coffee
</a>
<a class="source" href="register.html">
register.coffee
</a>
<a class="source" href="repl.html">
repl.coffee
</a>
<a class="source" href="rewriter.html">
rewriter.coffee
</a>
<a class="source" href="scope.html">
scope.litcoffee
</a>
<a class="source" href="sourcemap.html">
sourcemap.litcoffee
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>command.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<p>The <code>coffee</code> utility. Handles command-line compilation of CoffeeScript
into various forms: saved into <code>.js</code> files or printed to stdout
or recompiled every time the source is saved,
printed as a token stream or as the syntax tree, or launch an
interactive REPL.</p>
</div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>External dependencies.</p>
</div>
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span>
{spawn, exec} = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
{EventEmitter} = <span class="hljs-built_in">require</span> <span class="hljs-string">'events'</span>
useWinPathSep = path.sep <span class="hljs-keyword">is</span> <span class="hljs-string">'\\'</span></pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>Allow CoffeeScript to emit Node.js events.</p>
</div>
<div class="content"><div class='highlight'><pre>helpers.extend CoffeeScript, <span class="hljs-keyword">new</span> EventEmitter
<span class="hljs-function">
<span class="hljs-title">printLine</span> = <span class="hljs-params">(line)</span> -></span> process.stdout.write line + <span class="hljs-string">'\n'</span>
<span class="hljs-function"><span class="hljs-title">printWarn</span> = <span class="hljs-params">(line)</span> -></span> process.stderr.write line + <span class="hljs-string">'\n'</span>
<span class="hljs-function">
<span class="hljs-title">hidden</span> = <span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/^\.|~$/</span>.test file</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
<p>The help banner that is printed in conjunction with <code>-h</code>/<code>--help</code>.</p>
</div>
<div class="content"><div class='highlight'><pre>BANNER = <span class="hljs-string">'''
Usage: coffee [options] path/to/script.coffee -- [args]
If called without options, `coffee` will run your script.
'''</span></pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>The list of all the valid option flags that <code>coffee</code> knows how to handle.</p>
</div>
<div class="content"><div class='highlight'><pre>SWITCHES = [
[<span class="hljs-string">'-b'</span>, <span class="hljs-string">'--bare'</span>, <span class="hljs-string">'compile without a top-level function wrapper'</span>]
[<span class="hljs-string">'-c'</span>, <span class="hljs-string">'--compile'</span>, <span class="hljs-string">'compile to JavaScript and save as .js files'</span>]
[<span class="hljs-string">'-e'</span>, <span class="hljs-string">'--eval'</span>, <span class="hljs-string">'pass a string from the command line as input'</span>]
[<span class="hljs-string">'-h'</span>, <span class="hljs-string">'--help'</span>, <span class="hljs-string">'display this help message'</span>]
[<span class="hljs-string">'-i'</span>, <span class="hljs-string">'--interactive'</span>, <span class="hljs-string">'run an interactive CoffeeScript REPL'</span>]
[<span class="hljs-string">'-j'</span>, <span class="hljs-string">'--join [FILE]'</span>, <span class="hljs-string">'concatenate the source CoffeeScript before compiling'</span>]
[<span class="hljs-string">'-m'</span>, <span class="hljs-string">'--map'</span>, <span class="hljs-string">'generate source map and save as .js.map files'</span>]
[<span class="hljs-string">'-M'</span>, <span class="hljs-string">'--inline-map'</span>, <span class="hljs-string">'generate source map and include it directly in output'</span>]
[<span class="hljs-string">'-n'</span>, <span class="hljs-string">'--nodes'</span>, <span class="hljs-string">'print out the parse tree that the parser produces'</span>]
[ <span class="hljs-string">'--nodejs [ARGS]'</span>, <span class="hljs-string">'pass options directly to the "node" binary'</span>]
[ <span class="hljs-string">'--no-header'</span>, <span class="hljs-string">'suppress the "Generated by" header'</span>]
[<span class="hljs-string">'-o'</span>, <span class="hljs-string">'--output [DIR]'</span>, <span class="hljs-string">'set the output directory for compiled JavaScript'</span>]
[<span class="hljs-string">'-p'</span>, <span class="hljs-string">'--print'</span>, <span class="hljs-string">'print out the compiled JavaScript'</span>]
[<span class="hljs-string">'-r'</span>, <span class="hljs-string">'--require [MODULE*]'</span>, <span class="hljs-string">'require the given module before eval or REPL'</span>]
[<span class="hljs-string">'-s'</span>, <span class="hljs-string">'--stdio'</span>, <span class="hljs-string">'listen for and compile scripts over stdio'</span>]
[<span class="hljs-string">'-l'</span>, <span class="hljs-string">'--literate'</span>, <span class="hljs-string">'treat stdio as literate style coffee-script'</span>]
[<span class="hljs-string">'-t'</span>, <span class="hljs-string">'--tokens'</span>, <span class="hljs-string">'print out the tokens that the lexer/rewriter produce'</span>]
[<span class="hljs-string">'-v'</span>, <span class="hljs-string">'--version'</span>, <span class="hljs-string">'display the version number'</span>]
[<span class="hljs-string">'-w'</span>, <span class="hljs-string">'--watch'</span>, <span class="hljs-string">'watch scripts for changes and rerun commands'</span>]
]</pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>Top-level objects shared by all the functions.</p>
</div>
<div class="content"><div class='highlight'><pre>opts = {}
sources = []
sourceCode = []
notSources = {}
watchedDirs = {}
optionParser = <span class="hljs-literal">null</span></pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>Run <code>coffee</code> by parsing passed options and determining what action to take.
Many flags cause us to divert before compiling anything. Flags passed after
<code>--</code> will be passed verbatim to your script as arguments in <code>process.argv</code></p>
</div>
<div class="content"><div class='highlight'><pre>exports.run = <span class="hljs-function">-></span>
parseOptions()</pre></div></div>
</li>
<li id="section-8">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">¶</a>
</div>
<p>Make the REPL <em>CLI</em> use the global context so as to (a) be consistent with the
<code>node</code> REPL CLI and, therefore, (b) make packages that modify native prototypes
(such as ‘colors’ and ‘sugar’) work as expected.</p>
</div>
<div class="content"><div class='highlight'><pre> replCliOpts = useGlobal: <span class="hljs-literal">yes</span>
opts.prelude = makePrelude opts.<span class="hljs-built_in">require</span> <span class="hljs-keyword">if</span> opts.<span class="hljs-built_in">require</span>
replCliOpts.prelude = opts.prelude
<span class="hljs-keyword">return</span> forkNode() <span class="hljs-keyword">if</span> opts.nodejs
<span class="hljs-keyword">return</span> usage() <span class="hljs-keyword">if</span> opts.help
<span class="hljs-keyword">return</span> version() <span class="hljs-keyword">if</span> opts.version
<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'./repl'</span>).start(replCliOpts) <span class="hljs-keyword">if</span> opts.interactive
<span class="hljs-keyword">return</span> compileStdio() <span class="hljs-keyword">if</span> opts.stdio
<span class="hljs-keyword">return</span> compileScript <span class="hljs-literal">null</span>, opts.arguments[<span class="hljs-number">0</span>] <span class="hljs-keyword">if</span> opts.eval
<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'./repl'</span>).start(replCliOpts) <span class="hljs-keyword">unless</span> opts.arguments.length
literals = <span class="hljs-keyword">if</span> opts.run <span class="hljs-keyword">then</span> opts.arguments.splice <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> []
process.argv = process.argv[<span class="hljs-number">0.</span><span class="hljs-number">.1</span>].concat literals
process.argv[<span class="hljs-number">0</span>] = <span class="hljs-string">'coffee'</span>
opts.output = path.resolve opts.output <span class="hljs-keyword">if</span> opts.output
<span class="hljs-keyword">if</span> opts.join
opts.join = path.resolve opts.join
<span class="hljs-built_in">console</span>.error <span class="hljs-string">'''
The --join option is deprecated and will be removed in a future version.
If for some reason it's necessary to share local variables between files,
replace...
$ coffee --compile --join bundle.js -- a.coffee b.coffee c.coffee
with...
$ cat a.coffee b.coffee c.coffee | coffee --compile --stdio > bundle.js
'''</span>
<span class="hljs-keyword">for</span> source <span class="hljs-keyword">in</span> opts.arguments
source = path.resolve source
compilePath source, <span class="hljs-literal">yes</span>, source
<span class="hljs-function">
<span class="hljs-title">makePrelude</span> = <span class="hljs-params">(requires)</span> -></span>
requires.map (<span class="hljs-built_in">module</span>) ->
[_, name, <span class="hljs-built_in">module</span>] = match <span class="hljs-keyword">if</span> match = <span class="hljs-built_in">module</span>.match(<span class="hljs-regexp">/^(.*)=(.*)$/</span>)
name ||= helpers.baseFileName <span class="hljs-built_in">module</span>, <span class="hljs-literal">yes</span>, useWinPathSep
<span class="hljs-string">"<span class="hljs-subst">#{name}</span> = require('<span class="hljs-subst">#{<span class="hljs-built_in">module</span>}</span>')"</span>
.join <span class="hljs-string">';'</span></pre></div></div>
</li>
<li id="section-9">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-9">¶</a>
</div>
<p>Compile a path, which could be a script or a directory. If a directory
is passed, recursively compile all ‘.coffee’, ‘.litcoffee’, and ‘.coffee.md’
extension source files in it and all subdirectories.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compilePath</span> = <span class="hljs-params">(source, topLevel, base)</span> -></span>
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> source <span class="hljs-keyword">in</span> sources <span class="hljs-keyword">or</span>
watchedDirs[source] <span class="hljs-keyword">or</span>
<span class="hljs-keyword">not</span> topLevel <span class="hljs-keyword">and</span> (notSources[source] <span class="hljs-keyword">or</span> hidden source)
<span class="hljs-keyword">try</span>
stats = fs.statSync source
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
<span class="hljs-built_in">console</span>.error <span class="hljs-string">"File not found: <span class="hljs-subst">#{source}</span>"</span>
process.exit <span class="hljs-number">1</span>
<span class="hljs-keyword">throw</span> err
<span class="hljs-keyword">if</span> stats.isDirectory()
<span class="hljs-keyword">if</span> path.basename(source) <span class="hljs-keyword">is</span> <span class="hljs-string">'node_modules'</span>
notSources[source] = <span class="hljs-literal">yes</span>
<span class="hljs-keyword">return</span>
<span class="hljs-keyword">if</span> opts.run
compilePath findDirectoryIndex(source), topLevel, base
<span class="hljs-keyword">return</span>
watchDir source, base <span class="hljs-keyword">if</span> opts.watch
<span class="hljs-keyword">try</span>
files = fs.readdirSync source
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span> <span class="hljs-keyword">then</span> <span class="hljs-keyword">return</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">throw</span> err
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> files
compilePath (path.join source, file), <span class="hljs-literal">no</span>, base
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> topLevel <span class="hljs-keyword">or</span> helpers.isCoffee source
sources.push source
sourceCode.push <span class="hljs-literal">null</span>
<span class="hljs-keyword">delete</span> notSources[source]
watch source, base <span class="hljs-keyword">if</span> opts.watch
<span class="hljs-keyword">try</span>
code = fs.readFileSync source
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">if</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span> <span class="hljs-keyword">then</span> <span class="hljs-keyword">return</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">throw</span> err
compileScript(source, code.toString(), base)
<span class="hljs-keyword">else</span>
notSources[source] = <span class="hljs-literal">yes</span>
<span class="hljs-function">
<span class="hljs-title">findDirectoryIndex</span> = <span class="hljs-params">(source)</span> -></span>
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> CoffeeScript.FILE_EXTENSIONS
index = path.join source, <span class="hljs-string">"index<span class="hljs-subst">#{ext}</span>"</span>
<span class="hljs-keyword">try</span>
<span class="hljs-keyword">return</span> index <span class="hljs-keyword">if</span> (fs.statSync index).isFile()
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
<span class="hljs-built_in">console</span>.error <span class="hljs-string">"Missing index.coffee or index.litcoffee in <span class="hljs-subst">#{source}</span>"</span>
process.exit <span class="hljs-number">1</span></pre></div></div>
</li>
<li id="section-10">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-10">¶</a>
</div>
<p>Compile a single source script, containing the given code, according to the
requested options. If evaluating the script directly sets <code>__filename</code>,
<code>__dirname</code> and <code>module.filename</code> to be correct relative to the script’s path.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileScript</span> = <span class="hljs-params">(file, input, base = <span class="hljs-literal">null</span>)</span> -></span>
o = opts
options = compileOptions file, base
<span class="hljs-keyword">try</span>
t = task = {file, input, options}
CoffeeScript.emit <span class="hljs-string">'compile'</span>, task
<span class="hljs-keyword">if</span> o.tokens
printTokens CoffeeScript.tokens t.input, t.options
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.nodes
printLine CoffeeScript.nodes(t.input, t.options).toString().trim()
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.run
CoffeeScript.register()
CoffeeScript.eval opts.prelude, t.options <span class="hljs-keyword">if</span> opts.prelude
CoffeeScript.run t.input, t.options
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.join <span class="hljs-keyword">and</span> t.file <span class="hljs-keyword">isnt</span> o.join
t.input = helpers.invertLiterate t.input <span class="hljs-keyword">if</span> helpers.isLiterate file
sourceCode[sources.indexOf(t.file)] = t.input
compileJoin()
<span class="hljs-keyword">else</span>
compiled = CoffeeScript.compile t.input, t.options
t.output = compiled
<span class="hljs-keyword">if</span> o.map
t.output = compiled.js
t.sourceMap = compiled.v3SourceMap
CoffeeScript.emit <span class="hljs-string">'success'</span>, task
<span class="hljs-keyword">if</span> o.<span class="hljs-built_in">print</span>
printLine t.output.trim()
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> o.compile <span class="hljs-keyword">or</span> o.map
writeJs base, t.file, t.output, options.jsPath, t.sourceMap
<span class="hljs-keyword">catch</span> err
CoffeeScript.emit <span class="hljs-string">'failure'</span>, err, task
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> CoffeeScript.listeners(<span class="hljs-string">'failure'</span>).length
message = err?.stack <span class="hljs-keyword">or</span> <span class="hljs-string">"<span class="hljs-subst">#{err}</span>"</span>
<span class="hljs-keyword">if</span> o.watch
printLine message + <span class="hljs-string">'\x07'</span>
<span class="hljs-keyword">else</span>
printWarn message
process.exit <span class="hljs-number">1</span></pre></div></div>
</li>
<li id="section-11">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">¶</a>
</div>
<p>Attach the appropriate listeners to compile scripts incoming over <strong>stdin</strong>,
and write them back to <strong>stdout</strong>.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileStdio</span> = -></span>
buffers = []
stdin = process.openStdin()
stdin.<span class="hljs-literal">on</span> <span class="hljs-string">'data'</span>, <span class="hljs-function"><span class="hljs-params">(buffer)</span> -></span>
buffers.push buffer <span class="hljs-keyword">if</span> buffer
stdin.<span class="hljs-literal">on</span> <span class="hljs-string">'end'</span>, <span class="hljs-function">-></span>
compileScript <span class="hljs-literal">null</span>, Buffer.concat(buffers).toString()</pre></div></div>
</li>
<li id="section-12">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">¶</a>
</div>
<p>If all of the source files are done being read, concatenate and compile
them together.</p>
</div>
<div class="content"><div class='highlight'><pre>joinTimeout = <span class="hljs-literal">null</span>
<span class="hljs-function"><span class="hljs-title">compileJoin</span> = -></span>
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> opts.join
<span class="hljs-keyword">unless</span> sourceCode.some(<span class="hljs-function"><span class="hljs-params">(code)</span> -></span> code <span class="hljs-keyword">is</span> <span class="hljs-literal">null</span>)
clearTimeout joinTimeout
joinTimeout = wait <span class="hljs-number">100</span>, <span class="hljs-function">-></span>
compileScript opts.join, sourceCode.join(<span class="hljs-string">'\n'</span>), opts.join</pre></div></div>
</li>
<li id="section-13">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-13">¶</a>
</div>
<p>Watch a source CoffeeScript file using <code>fs.watch</code>, recompiling it every
time the file is updated. May be used in combination with other options,
such as <code>--print</code>.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">watch</span> = <span class="hljs-params">(source, base)</span> -></span>
watcher = <span class="hljs-literal">null</span>
prevStats = <span class="hljs-literal">null</span>
compileTimeout = <span class="hljs-literal">null</span>
<span class="hljs-function">
<span class="hljs-title">watchErr</span> = <span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> source <span class="hljs-keyword">in</span> sources
<span class="hljs-keyword">try</span>
rewatch()
compile()
<span class="hljs-keyword">catch</span>
removeSource source, base
compileJoin()
<span class="hljs-function">
<span class="hljs-title">compile</span> = -></span>
clearTimeout compileTimeout
compileTimeout = wait <span class="hljs-number">25</span>, <span class="hljs-function">-></span>
fs.stat source, <span class="hljs-function"><span class="hljs-params">(err, stats)</span> -></span>
<span class="hljs-keyword">return</span> watchErr err <span class="hljs-keyword">if</span> err
<span class="hljs-keyword">return</span> rewatch() <span class="hljs-keyword">if</span> prevStats <span class="hljs-keyword">and</span>
stats.size <span class="hljs-keyword">is</span> prevStats.size <span class="hljs-keyword">and</span>
stats.mtime.getTime() <span class="hljs-keyword">is</span> prevStats.mtime.getTime()
prevStats = stats
fs.readFile source, <span class="hljs-function"><span class="hljs-params">(err, code)</span> -></span>
<span class="hljs-keyword">return</span> watchErr err <span class="hljs-keyword">if</span> err
compileScript(source, code.toString(), base)
rewatch()
<span class="hljs-function">
<span class="hljs-title">startWatcher</span> = -></span>
watcher = fs.watch source
.<span class="hljs-literal">on</span> <span class="hljs-string">'change'</span>, compile
.<span class="hljs-literal">on</span> <span class="hljs-string">'error'</span>, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'EPERM'</span>
removeSource source, base
<span class="hljs-function">
<span class="hljs-title">rewatch</span> = -></span>
watcher?.close()
startWatcher()
<span class="hljs-keyword">try</span>
startWatcher()
<span class="hljs-keyword">catch</span> err
watchErr err</pre></div></div>
</li>
<li id="section-14">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-14">¶</a>
</div>
<p>Watch a directory of files for new additions.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">watchDir</span> = <span class="hljs-params">(source, base)</span> -></span>
watcher = <span class="hljs-literal">null</span>
readdirTimeout = <span class="hljs-literal">null</span>
<span class="hljs-function">
<span class="hljs-title">startWatcher</span> = -></span>
watcher = fs.watch source
.<span class="hljs-literal">on</span> <span class="hljs-string">'error'</span>, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'EPERM'</span>
stopWatcher()
.<span class="hljs-literal">on</span> <span class="hljs-string">'change'</span>, <span class="hljs-function">-></span>
clearTimeout readdirTimeout
readdirTimeout = wait <span class="hljs-number">25</span>, <span class="hljs-function">-></span>
<span class="hljs-keyword">try</span>
files = fs.readdirSync source
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
<span class="hljs-keyword">return</span> stopWatcher()
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> files
compilePath (path.join source, file), <span class="hljs-literal">no</span>, base
<span class="hljs-function">
<span class="hljs-title">stopWatcher</span> = -></span>
watcher.close()
removeSourceDir source, base
watchedDirs[source] = <span class="hljs-literal">yes</span>
<span class="hljs-keyword">try</span>
startWatcher()
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">is</span> <span class="hljs-string">'ENOENT'</span>
<span class="hljs-function">
<span class="hljs-title">removeSourceDir</span> = <span class="hljs-params">(source, base)</span> -></span>
<span class="hljs-keyword">delete</span> watchedDirs[source]
sourcesChanged = <span class="hljs-literal">no</span>
<span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> sources <span class="hljs-keyword">when</span> source <span class="hljs-keyword">is</span> path.dirname file
removeSource file, base
sourcesChanged = <span class="hljs-literal">yes</span>
compileJoin() <span class="hljs-keyword">if</span> sourcesChanged</pre></div></div>
</li>
<li id="section-15">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-15">¶</a>
</div>
<p>Remove a file from our source list, and source code cache. Optionally remove
the compiled JS version as well.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">removeSource</span> = <span class="hljs-params">(source, base)</span> -></span>
index = sources.indexOf source
sources.splice index, <span class="hljs-number">1</span>
sourceCode.splice index, <span class="hljs-number">1</span>
<span class="hljs-keyword">unless</span> opts.join
silentUnlink outputPath source, base
silentUnlink outputPath source, base, <span class="hljs-string">'.js.map'</span>
timeLog <span class="hljs-string">"removed <span class="hljs-subst">#{source}</span>"</span>
<span class="hljs-function">
<span class="hljs-title">silentUnlink</span> = <span class="hljs-params">(path)</span> -></span>
<span class="hljs-keyword">try</span>
fs.unlinkSync path
<span class="hljs-keyword">catch</span> err
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">unless</span> err.code <span class="hljs-keyword">in</span> [<span class="hljs-string">'ENOENT'</span>, <span class="hljs-string">'EPERM'</span>]</pre></div></div>
</li>
<li id="section-16">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-16">¶</a>
</div>
<p>Get the corresponding output JavaScript path for a source file.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">outputPath</span> = <span class="hljs-params">(source, base, extension=<span class="hljs-string">".js"</span>)</span> -></span>
basename = helpers.baseFileName source, <span class="hljs-literal">yes</span>, useWinPathSep
srcDir = path.dirname source
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> opts.output
dir = srcDir
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> source <span class="hljs-keyword">is</span> base
dir = opts.output
<span class="hljs-keyword">else</span>
dir = path.join opts.output, path.relative base, srcDir
path.join dir, basename + extension</pre></div></div>
</li>
<li id="section-17">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-17">¶</a>
</div>
<p>Recursively mkdir, like <code>mkdir -p</code>.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">mkdirp</span> = <span class="hljs-params">(dir, fn)</span> -></span>
mode = <span class="hljs-number">0</span>o777 & ~process.umask()
<span class="hljs-keyword">do</span> mkdirs = <span class="hljs-function"><span class="hljs-params">(p = dir, fn)</span> -></span>
fs.exists p, <span class="hljs-function"><span class="hljs-params">(exists)</span> -></span>
<span class="hljs-keyword">if</span> exists
fn()
<span class="hljs-keyword">else</span>
mkdirs path.dirname(p), <span class="hljs-function">-></span>
fs.mkdir p, mode, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">return</span> fn err <span class="hljs-keyword">if</span> err
fn()</pre></div></div>
</li>
<li id="section-18">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-18">¶</a>
</div>
<p>Write out a JavaScript source file with the compiled code. By default, files
are written out in <code>cwd</code> as <code>.js</code> files with the same name, but the output
directory can be customized with <code>--output</code>.</p>
<p>If <code>generatedSourceMap</code> is provided, this will write a <code>.js.map</code> file into the
same directory as the <code>.js</code> file.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">writeJs</span> = <span class="hljs-params">(base, sourcePath, js, jsPath, generatedSourceMap = <span class="hljs-literal">null</span>)</span> -></span>
sourceMapPath = outputPath sourcePath, base, <span class="hljs-string">".js.map"</span>
jsDir = path.dirname jsPath
<span class="hljs-function"> <span class="hljs-title">compile</span> = -></span>
<span class="hljs-keyword">if</span> opts.compile
js = <span class="hljs-string">' '</span> <span class="hljs-keyword">if</span> js.length <= <span class="hljs-number">0</span>
<span class="hljs-keyword">if</span> generatedSourceMap <span class="hljs-keyword">then</span> js = <span class="hljs-string">"<span class="hljs-subst">#{js}</span>\n//# sourceMappingURL=<span class="hljs-subst">#{helpers.baseFileName sourceMapPath, <span class="hljs-literal">no</span>, useWinPathSep}</span>\n"</span>
fs.writeFile jsPath, js, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">if</span> err
printLine err.message
process.exit <span class="hljs-number">1</span>
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> opts.compile <span class="hljs-keyword">and</span> opts.watch
timeLog <span class="hljs-string">"compiled <span class="hljs-subst">#{sourcePath}</span>"</span>
<span class="hljs-keyword">if</span> generatedSourceMap
fs.writeFile sourceMapPath, generatedSourceMap, <span class="hljs-function"><span class="hljs-params">(err)</span> -></span>
<span class="hljs-keyword">if</span> err
printLine <span class="hljs-string">"Could not write source map: <span class="hljs-subst">#{err.message}</span>"</span>
process.exit <span class="hljs-number">1</span>
fs.exists jsDir, <span class="hljs-function"><span class="hljs-params">(itExists)</span> -></span>
<span class="hljs-keyword">if</span> itExists <span class="hljs-keyword">then</span> compile() <span class="hljs-keyword">else</span> mkdirp jsDir, compile</pre></div></div>
</li>
<li id="section-19">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-19">¶</a>
</div>
<p>Convenience for cleaner setTimeouts.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">wait</span> = <span class="hljs-params">(milliseconds, func)</span> -></span> setTimeout func, milliseconds</pre></div></div>
</li>
<li id="section-20">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-20">¶</a>
</div>
<p>When watching scripts, it’s useful to log changes with the timestamp.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">timeLog</span> = <span class="hljs-params">(message)</span> -></span>
<span class="hljs-built_in">console</span>.log <span class="hljs-string">"<span class="hljs-subst">#{(<span class="hljs-keyword">new</span> Date).toLocaleTimeString()}</span> - <span class="hljs-subst">#{message}</span>"</span></pre></div></div>
</li>
<li id="section-21">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-21">¶</a>
</div>
<p>Pretty-print a stream of tokens, sans location data.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">printTokens</span> = <span class="hljs-params">(tokens)</span> -></span>
strings = <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens
tag = token[<span class="hljs-number">0</span>]
value = token[<span class="hljs-number">1</span>].toString().replace(<span class="hljs-regexp">/\n/</span>, <span class="hljs-string">'\\n'</span>)
<span class="hljs-string">"[<span class="hljs-subst">#{tag}</span> <span class="hljs-subst">#{value}</span>]"</span>
printLine strings.join(<span class="hljs-string">' '</span>)</pre></div></div>
</li>
<li id="section-22">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-22">¶</a>
</div>
<p>Use the <a href="optparse.html">OptionParser module</a> to extract all options from
<code>process.argv</code> that are specified in <code>SWITCHES</code>.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">parseOptions</span> = -></span>
optionParser = <span class="hljs-keyword">new</span> optparse.OptionParser SWITCHES, BANNER
o = opts = optionParser.parse process.argv[<span class="hljs-number">2.</span>.]
o.compile <span class="hljs-keyword">or</span>= !!o.output
o.run = <span class="hljs-keyword">not</span> (o.compile <span class="hljs-keyword">or</span> o.<span class="hljs-built_in">print</span> <span class="hljs-keyword">or</span> o.map)
o.<span class="hljs-built_in">print</span> = !! (o.<span class="hljs-built_in">print</span> <span class="hljs-keyword">or</span> (o.eval <span class="hljs-keyword">or</span> o.stdio <span class="hljs-keyword">and</span> o.compile))</pre></div></div>
</li>
<li id="section-23">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-23">¶</a>
</div>
<p>The compile-time options to pass to the CoffeeScript compiler.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">compileOptions</span> = <span class="hljs-params">(filename, base)</span> -></span>
answer = {
filename
literate: opts.literate <span class="hljs-keyword">or</span> helpers.isLiterate(filename)
bare: opts.bare
header: opts.compile <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> opts[<span class="hljs-string">'no-header'</span>]
sourceMap: opts.map
inlineMap: opts[<span class="hljs-string">'inline-map'</span>]
}
<span class="hljs-keyword">if</span> filename
<span class="hljs-keyword">if</span> base
cwd = process.cwd()
jsPath = outputPath filename, base
jsDir = path.dirname jsPath
answer = helpers.merge answer, {
jsPath
sourceRoot: path.relative jsDir, cwd
sourceFiles: [path.relative cwd, filename]
generatedFile: helpers.baseFileName(jsPath, <span class="hljs-literal">no</span>, useWinPathSep)
}
<span class="hljs-keyword">else</span>
answer = helpers.merge answer,
sourceRoot: <span class="hljs-string">""</span>
sourceFiles: [helpers.baseFileName filename, <span class="hljs-literal">no</span>, useWinPathSep]
generatedFile: helpers.baseFileName(filename, <span class="hljs-literal">yes</span>, useWinPathSep) + <span class="hljs-string">".js"</span>
answer</pre></div></div>
</li>
<li id="section-24">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-24">¶</a>
</div>
<p>Start up a new Node.js instance with the arguments in <code>--nodejs</code> passed to
the <code>node</code> binary, preserving the other options.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">forkNode</span> = -></span>
nodeArgs = opts.nodejs.split <span class="hljs-regexp">/\s+/</span>
args = process.argv[<span class="hljs-number">1.</span>.]
args.splice args.indexOf(<span class="hljs-string">'--nodejs'</span>), <span class="hljs-number">2</span>
p = spawn process.execPath, nodeArgs.concat(args),
cwd: process.cwd()
env: process.env
stdio: [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>]
p.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function"><span class="hljs-params">(code)</span> -></span> process.exit code</pre></div></div>
</li>
<li id="section-25">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-25">¶</a>
</div>
<p>Print the <code>--help</code> usage message and exit. Deprecated switches are not
shown.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">usage</span> = -></span>
printLine (<span class="hljs-keyword">new</span> optparse.OptionParser SWITCHES, BANNER).help()</pre></div></div>
</li>
<li id="section-26">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-26">¶</a>
</div>
<p>Print the <code>--version</code> message and exit.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">version</span> = -></span>
printLine <span class="hljs-string">"CoffeeScript version <span class="hljs-subst">#{CoffeeScript.VERSION}</span>"</span></pre></div></div>
</li>
</ul>
</div>
</body>
</html>
================================================
FILE: docs/v1/annotated-source/docco.css
================================================
/*--------------------- Typography ----------------------------*/
@font-face {
font-family: 'aller-light';
src: url('public/fonts/aller-light.eot');
src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
url('public/fonts/aller-light.woff') format('woff'),
url('public/fonts/aller-light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'aller-bold';
src: url('public/fonts/aller-bold.eot');
src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
url('public/fonts/aller-bold.woff') format('woff'),
url('public/fonts/aller-bold.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'roboto-black';
src: url('public/fonts/roboto-black.eot');
src: url('public/fonts/roboto-black.eot?#iefix') format('embedded-opentype'),
url('public/fonts/roboto-black.woff') format('woff'),
url('public/fonts/roboto-black.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
/*--------------------- Layout ----------------------------*/
html { height: 100%; }
body {
font-family: "aller-light";
font-size: 14px;
line-height: 18px;
color: #30404f;
margin: 0; padding: 0;
height:100%;
}
#container { min-height: 100%; }
a {
color: #000;
}
b, strong {
font-weight: normal;
font-family: "aller-bold";
}
p {
margin: 15px 0 0px;
}
.annotation ul, .annotation ol {
margin: 25px 0;
}
.annotation ul li, .annotation ol li {
font-size: 14px;
line-height: 18px;
margin: 10px 0;
}
h1, h2, h3, h4, h5, h6 {
color: #112233;
line-height: 1em;
font-weight: normal;
font-family: "roboto-black";
text-transform: uppercase;
margin: 30px 0 15px 0;
}
h1 {
margin-top: 40px;
}
h2 {
font-size: 1.26em;
}
hr {
border: 0;
background: 1px #ddd;
height: 1px;
margin: 20px 0;
}
pre, tt, code {
font-size: 12px; line-height: 16px;
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0;
}
.annotation pre {
display: block;
margin: 0;
padding: 7px 10px;
background: #fcfcfc;
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
overflow-x: auto;
}
.annotation pre code {
border: 0;
padding: 0;
background: transparent;
}
blockquote {
border-left: 5px solid #ccc;
margin: 0;
padding: 1px 0 1px 1em;
}
.sections blockquote p {
font-family: Menlo, Consolas, Monaco, monospace;
font-size: 12px; line-height: 16px;
color: #999;
margin: 10px 0 0;
white-space: pre-wrap;
}
ul.sections {
list-style: none;
padding:0 0 5px 0;;
margin:0;
}
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
ul.sections > li > div {
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
box-sizing: border-box; /* css3 */
}
/*---------------------- Jump Page -----------------------------*/
#jump_to, #jump_page {
margin: 0;
background: white;
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
font: 16px Arial;
cursor: pointer;
text-align: right;
list-style: none;
}
#jump_to a {
text-decoration: none;
}
#jump_to a.large {
display: none;
}
#jump_to a.small {
font-size: 22px;
font-weight: bold;
color: #676767;
}
#jump_to, #jump_wrapper {
position: fixed;
right: 0; top: 0;
padding: 10px 15px;
margin:0;
}
#jump_wrapper {
display: none;
padding:0;
}
#jump_to:hover #jump_wrapper {
display: block;
}
#jump_page_wrapper{
position: fixed;
right: 0;
top: 0;
bottom: 0;
}
#jump_page {
padding: 5px 0 3px;
margin: 0 0 25px 25px;
max-height: 100%;
overflow: auto;
}
#jump_page .source {
display: block;
padding: 15px;
text-decoration: none;
border-top: 1px solid #eee;
}
#jump_page .source:hover {
background: #f5f5ff;
}
#jump_page .source:first-child {
}
/*---------------------- Low resolutions (> 320px) ---------------------*/
@media only screen and (min-width: 320px) {
.pilwrap { display: none; }
ul.sections > li > div {
display: block;
padding:5px 10px 0 10px;
}
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
padding-left: 30px;
}
ul.sections > li > div.content {
overflow-x:auto;
-webkit-box-shadow: inset 0 0 5px #e5e5ee;
box-shadow: inset 0 0 5px #e5e5ee;
border: 1px solid #dedede;
margin:5px 10px 5px 10px;
padding-bottom: 5px;
}
ul.sections > li > div.annotation pre {
margin: 7px 0 7px;
padding-left: 15px;
}
ul.sections > li > div.annotation p tt, .annotation code {
background: #f8f8ff;
border: 1px solid #dedede;
font-size: 12px;
padding: 0 0.2em;
}
}
/*---------------------- (> 481px) ---------------------*/
@media only screen and (min-width: 481px) {
#container {
position: relative;
}
body {
background-color: #F5F5FF;
font-size: 15px;
line-height: 21px;
}
pre, tt, code {
line-height: 18px;
}
p, ul, ol {
margin: 0 0 15px;
}
#jump_to {
padding: 5px 10px;
}
#jump_wrapper {
padding: 0;
}
#jump_to, #jump_page {
font: 10px Arial;
text-transform: uppercase;
}
#jump_page .source {
padding: 5px 10px;
}
#jump_to a.large {
display: inline-block;
}
#jump_to a.small {
display: none;
}
#background {
position: absolute;
top: 0; bottom: 0;
width: 350px;
background: #fff;
border-right: 1px solid #e5e5ee;
z-index: -1;
}
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
padding-left: 40px;
}
ul.sections > li {
white-space: nowrap;
}
ul.sections > li > div {
display: inline-block;
}
ul.sections > li > div.annotation {
max-width: 350px;
min-width: 350px;
min-height: 5px;
padding: 13px;
overflow-x: hidden;
white-space: normal;
vertical-align: top;
text-align: left;
}
ul.sections > li > div.annotation pre {
margin: 15px 0 15px;
padding-left: 15px;
}
ul.sections > li > div.content {
padding: 13px;
vertical-align: top;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.pilwrap {
position: relative;
display: inline;
}
.pilcrow {
font: 12px Arial;
text-decoration: none;
color: #454545;
position: absolute;
top: 3px; left: -20px;
padding: 1px 2px;
opacity: 0;
-webkit-transition: opacity 0.2s linear;
}
.for-h1 .pilcrow {
top: 47px;
}
.for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
top: 35px;
}
ul.sections > li > div.annotation:hover .pilcrow {
opacity: 1;
}
}
/*---------------------- (> 1025px) ---------------------*/
@media only screen and (min-width: 1025px) {
body {
font-size: 16px;
line-height: 24px;
}
#background {
width: 525px;
}
ul.sections > li > div.annotation {
max-width: 525px;
min-width: 525px;
padding: 10px 25px 1px 50px;
}
ul.sections > li > div.content {
padding: 9px 15px 16px 25px;
}
}
/*---------------------- Syntax Highlighting -----------------------------*/
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
pre code {
display: block; padding: 0.5em;
color: #000;
background: #f8f8ff
}
pre .hljs-comment,
pre .hljs-template_comment,
pre .hljs-diff .hljs-header,
pre .hljs-javadoc {
color: #408080;
font-style: italic
}
pre .hljs-keyword,
pre .hljs-assignment,
pre .hljs-literal,
pre .hljs-css .hljs-rule .hljs-keyword,
pre .hljs-winutils,
pre .hljs-javascript .hljs-title,
pre .hljs-lisp .hljs-title,
pre .hljs-subst {
color: #954121;
/*font-weight: bold*/
}
pre .hljs-number,
pre .hljs-hexcolor {
color: #40a070
}
pre .hljs-string,
pre .hljs-tag .hljs-value,
pre .hljs-phpdoc,
pre .hljs-tex .hljs-formula {
color: #219161;
}
pre .hljs-title,
pre .hljs-id {
color: #19469D;
}
pre .hljs-params {
color: #00F;
}
pre .hljs-javascript .hljs-title,
pre .hljs-lisp .hljs-title,
pre .hljs-subst {
font-weight: normal
}
pre .hljs-class .hljs-title,
pre .hljs-haskell .hljs-label,
pre .hljs-tex .hljs-command {
color: #458;
font-weight: bold
}
pre .hljs-tag,
pre .hljs-tag .hljs-title,
pre .hljs-rules .hljs-property,
pre .hljs-django .hljs-tag .hljs-keyword {
color: #000080;
font-weight: normal
}
pre .hljs-attribute,
pre .hljs-variable,
pre .hljs-instancevar,
pre .hljs-lisp .hljs-body {
color: #008080
}
pre .hljs-regexp {
color: #B68
}
pre .hljs-class {
color: #458;
font-weight: bold
}
pre .hljs-symbol,
pre .hljs-ruby .hljs-symbol .hljs-string,
pre .hljs-ruby .hljs-symbol .hljs-keyword,
pre .hljs-ruby .hljs-symbol .hljs-keymethods,
pre .hljs-lisp .hljs-keyword,
pre .hljs-tex .hljs-special,
pre .hljs-input_number {
color: #990073
}
pre .hljs-builtin,
pre .hljs-constructor,
pre .hljs-built_in,
pre .hljs-lisp .hljs-title {
color: #0086b3
}
pre .hljs-preprocessor,
pre .hljs-pi,
pre .hljs-doctype,
pre .hljs-shebang,
pre .hljs-cdata {
color: #999;
font-weight: bold
}
pre .hljs-deletion {
background: #fdd
}
pre .hljs-addition {
background: #dfd
}
pre .hljs-diff .hljs-change {
background: #0086b3
}
pre .hljs-chunk {
color: #aaa
}
pre .hljs-tex .hljs-formula {
opacity: 0.5;
}
================================================
FILE: docs/v1/annotated-source/grammar.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>grammar.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="browser.html">
browser.coffee
</a>
<a class="source" href="cake.html">
cake.coffee
</a>
<a class="source" href="coffee-script.html">
coffee-script.coffee
</a>
<a class="source" href="command.html">
command.coffee
</a>
<a class="source" href="grammar.html">
grammar.coffee
</a>
<a class="source" href="helpers.html">
helpers.coffee
</a>
<a class="source" href="index.html">
index.coffee
</a>
<a class="source" href="lexer.html">
lexer.coffee
</a>
<a class="source" href="nodes.html">
nodes.coffee
</a>
<a class="source" href="optparse.html">
optparse.coffee
</a>
<a class="source" href="register.html">
register.coffee
</a>
<a class="source" href="repl.html">
repl.coffee
</a>
<a class="source" href="rewriter.html">
rewriter.coffee
</a>
<a class="source" href="scope.html">
scope.litcoffee
</a>
<a class="source" href="sourcemap.html">
sourcemap.litcoffee
</a>
</div>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>grammar.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<p>The CoffeeScript parser is generated by <a href="https://github.com/zaach/jison">Jison</a>
from this grammar file. Jison is a bottom-up parser generator, similar in
style to <a href="http://www.gnu.org/software/bison">Bison</a>, implemented in JavaScript.
It can recognize <a href="https://en.wikipedia.org/wiki/LR_grammar">LALR(1), LR(0), SLR(1), and LR(1)</a>
type grammars. To create the Jison parser, we list the pattern to match
on the left-hand side, and the action to take (usually the creation of syntax
tree nodes) on the right. As the parser runs, it
shifts tokens from our token stream, from left to right, and
<a href="https://en.wikipedia.org/wiki/Bottom-up_parsing">attempts to match</a>
the token sequence against the rules below. When a match can be made, it
reduces into the <a href="https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols">nonterminal</a>
(the enclosing name at the top), and we proceed from there.</p>
<p>If you run the <code>cake build:parser</code> command, Jison constructs a parse table
from our rules and saves it into <code>lib/parser.js</code>.</p>
</div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>The only dependency is on the <strong>Jison.Parser</strong>.</p>
</div>
<div class="content"><div class='highlight'><pre>{Parser} = <span class="hljs-built_in">require</span> <span class="hljs-string">'jison'</span></pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<h2 id="jison-dsl">Jison DSL</h2>
</div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
</div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>Since we’re going to be wrapped in a function by Jison in any case, if our
action immediately returns a value, we can optimize by removing the function
wrapper and just returning the value directly.</p>
</div>
<div class="content"><div class='highlight'><pre>unwrap = <span class="hljs-regexp">/^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/</span></pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>Our handy DSL for Jison grammar generation, thanks to
<a href="https://github.com/creationix">Tim Caswell</a>. For every rule in the grammar,
we pass the pattern-defining string, the action to run, and extra options,
optionally. If no action is specified, we simply pass the value of the
previous nonterminal.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">o</span> = <span class="hljs-params">(patternString, action, options)</span> -></span>
patternString = patternString.replace <span class="hljs-regexp">/\s{2,}/g</span>, <span class="hljs-string">' '</span>
patternCount = patternString.split(<span class="hljs-string">' '</span>).length
<span class="hljs-keyword">return</span> [patternString, <span class="hljs-string">'$$ = $1;'</span>, options] <span class="hljs-keyword">unless</span> action
action = <span class="hljs-keyword">if</span> match = unwrap.exec action <span class="hljs-keyword">then</span> match[<span class="hljs-number">1</span>] <span class="hljs-keyword">else</span> <span class="hljs-string">"(<span class="hljs-subst">#{action}</span>())"</span></pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>All runtime functions we need are defined on “yy”</p>
</div>
<div class="content"><div class='highlight'><pre> action = action.replace <span class="hljs-regexp">/\bnew /g</span>, <span class="hljs-string">'$&yy.'</span>
action = action.replace <span class="hljs-regexp">/\b(?:Block\.wrap|extend)\b/g</span>, <span class="hljs-string">'yy.$&'</span></pre></div></div>
</li>
<li id="section-8">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">¶</a>
</div>
<p>Returns a function which adds location data to the first parameter passed
in, and returns the parameter. If the parameter is not a node, it will
just be passed through unaffected.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">addLocationDataFn</span> = <span class="hljs-params">(first, last)</span> -></span>
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> last
<span class="hljs-string">"yy.addLocationDataFn(@<span class="hljs-subst">#{first}</span>)"</span>
<span class="hljs-keyword">else</span>
<span class="hljs-string">"yy.addLocationDataFn(@<span class="hljs-subst">#{first}</span>, @<span class="hljs-subst">#{last}</span>)"</span>
action = action.replace <span class="hljs-regexp">/LOC\(([0-9]*)\)/g</span>, addLocationDataFn(<span class="hljs-string">'$1'</span>)
action = action.replace <span class="hljs-regexp">/LOC\(([0-9]*),\s*([0-9]*)\)/g</span>, addLocationDataFn(<span class="hljs-string">'$1'</span>, <span class="hljs-string">'$2'</span>)
[patternString, <span class="hljs-string">"$$ = <span class="hljs-subst">#{addLocationDataFn(<span class="hljs-number">1</span>, patternCount)}</span>(<span class="hljs-subst">#{action}</span>);"</span>, options]</pre></div></div>
</li>
<li id="section-9">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-9">¶</a>
</div>
<h2 id="grammatical-rules">Grammatical Rules</h2>
</div>
</li>
<li id="section-10">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-10">¶</a>
</div>
</div>
</li>
<li id="section-11">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">¶</a>
</div>
<p>In all of the rules that follow, you’ll see the name of the nonterminal as
the key to a list of alternative matches. With each match’s action, the
dollar-sign variables are provided by Jison as references to the value of
their numeric position, so in this rule:</p>
<pre><code><span class="hljs-string">"Expression UNLESS Expression"</span>
</code></pre><p><code>$1</code> would be the value of the first <code>Expression</code>, <code>$2</code> would be the token
for the <code>UNLESS</code> terminal, and <code>$3</code> would be the value of the second
<code>Expression</code>.</p>
</div>
<div class="content"><div class='highlight'><pre>grammar =</pre></div></div>
</li>
<li id="section-12">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">¶</a>
</div>
<p>The <strong>Root</strong> is the top-level node in the syntax tree. Since we parse bottom-up,
all parsing must end here.</p>
</div>
<div class="content"><div class='highlight'><pre> Root: [
o <span class="hljs-string">''</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Block
o <span class="hljs-string">'Body'</span>
]</pre></div></div>
</li>
<li id="section-13">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-13">¶</a>
</div>
<p>Any list of statements and expressions, separated by line breaks or semicolons.</p>
</div>
<div class="content"><div class='highlight'><pre> Body: [
o <span class="hljs-string">'Line'</span>, <span class="hljs-function">-></span> Block.wrap [$<span class="hljs-number">1</span>]
o <span class="hljs-string">'Body TERMINATOR Line'</span>, <span class="hljs-function">-></span> $<span class="hljs-number">1.</span>push $<span class="hljs-number">3</span>
o <span class="hljs-string">'Body TERMINATOR'</span>
]</pre></div></div>
</li>
<li id="section-14">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-14">¶</a>
</div>
<p>Block and statements, which make up a line in a body. YieldReturn is a
statement, but not included in Statement because that results in an ambiguous
grammar.</p>
</div>
<div class="content"><div class='highlight'><pre> Line: [
o <span class="hljs-string">'Expression'</span>
o <span class="hljs-string">'Statement'</span>
o <span class="hljs-string">'YieldReturn'</span>
]</pre></div></div>
</li>
<li id="section-15">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-15">¶</a>
</div>
<p>Pure statements which cannot be expressions.</p>
</div>
<div class="content"><div class='highlight'><pre> Statement: [
o <span class="hljs-string">'Return'</span>
o <span class="hljs-string">'Comment'</span>
o <span class="hljs-string">'STATEMENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> StatementLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'Import'</span>
o <span class="hljs-string">'Export'</span>
]</pre></div></div>
</li>
<li id="section-16">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-16">¶</a>
</div>
<p>All the different types of expressions in our language. The basic unit of
CoffeeScript is the <strong>Expression</strong> – everything that can be an expression
is one. Blocks serve as the building blocks of many other rules, making
them somewhat circular.</p>
</div>
<div class="content"><div class='highlight'><pre> Expression: [
o <span class="hljs-string">'Value'</span>
o <span class="hljs-string">'Invocation'</span>
o <span class="hljs-string">'Code'</span>
o <span class="hljs-string">'Operation'</span>
o <span class="hljs-string">'Assign'</span>
o <span class="hljs-string">'If'</span>
o <span class="hljs-string">'Try'</span>
o <span class="hljs-string">'While'</span>
o <span class="hljs-string">'For'</span>
o <span class="hljs-string">'Switch'</span>
o <span class="hljs-string">'Class'</span>
o <span class="hljs-string">'Throw'</span>
o <span class="hljs-string">'Yield'</span>
]
Yield: [
o <span class="hljs-string">'YIELD'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Op $<span class="hljs-number">1</span>, <span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Literal <span class="hljs-string">''</span>
o <span class="hljs-string">'YIELD Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Op $<span class="hljs-number">1</span>, $<span class="hljs-number">2</span>
o <span class="hljs-string">'YIELD FROM Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Op $<span class="hljs-number">1.</span>concat($<span class="hljs-number">2</span>), $<span class="hljs-number">3</span>
]</pre></div></div>
</li>
<li id="section-17">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-17">¶</a>
</div>
<p>An indented block of expressions. Note that the <a href="rewriter.html">Rewriter</a>
will convert some postfix forms into blocks for us, by adjusting the
token stream.</p>
</div>
<div class="content"><div class='highlight'><pre> Block: [
o <span class="hljs-string">'INDENT OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Block
o <span class="hljs-string">'INDENT Body OUTDENT'</span>, <span class="hljs-function">-></span> $<span class="hljs-number">2</span>
]
Identifier: [
o <span class="hljs-string">'IDENTIFIER'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> IdentifierLiteral $<span class="hljs-number">1</span>
]
Property: [
o <span class="hljs-string">'PROPERTY'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> PropertyName $<span class="hljs-number">1</span>
]</pre></div></div>
</li>
<li id="section-18">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-18">¶</a>
</div>
<p>Alphanumerics are separated from the other <strong>Literal</strong> matchers because
they can also serve as keys in object literals.</p>
</div>
<div class="content"><div class='highlight'><pre> AlphaNumeric: [
o <span class="hljs-string">'NUMBER'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> NumberLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'String'</span>
]
String: [
o <span class="hljs-string">'STRING'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> StringLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'STRING_START Body STRING_END'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> StringWithInterpolations $<span class="hljs-number">2</span>
]
Regex: [
o <span class="hljs-string">'REGEX'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> RegexLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'REGEX_START Invocation REGEX_END'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> RegexWithInterpolations $<span class="hljs-number">2.</span>args
]</pre></div></div>
</li>
<li id="section-19">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-19">¶</a>
</div>
<p>All of our immediate values. Generally these can be passed straight
through and printed to JavaScript.</p>
</div>
<div class="content"><div class='highlight'><pre> Literal: [
o <span class="hljs-string">'AlphaNumeric'</span>
o <span class="hljs-string">'JS'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> PassthroughLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'Regex'</span>
o <span class="hljs-string">'UNDEFINED'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> UndefinedLiteral
o <span class="hljs-string">'NULL'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> NullLiteral
o <span class="hljs-string">'BOOL'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> BooleanLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'INFINITY'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> InfinityLiteral $<span class="hljs-number">1</span>
o <span class="hljs-string">'NAN'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> NaNLiteral
]</pre></div></div>
</li>
<li id="section-20">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-20">¶</a>
</div>
<p>Assignment of a variable, property, or index to a value.</p>
</div>
<div class="content"><div class='highlight'><pre> Assign: [
o <span class="hljs-string">'Assignable = Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign $<span class="hljs-number">1</span>, $<span class="hljs-number">3</span>
o <span class="hljs-string">'Assignable = TERMINATOR Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign $<span class="hljs-number">1</span>, $<span class="hljs-number">4</span>
o <span class="hljs-string">'Assignable = INDENT Expression OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign $<span class="hljs-number">1</span>, $<span class="hljs-number">4</span>
]</pre></div></div>
</li>
<li id="section-21">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-21">¶</a>
</div>
<p>Assignment when it happens within an object literal. The difference from
the ordinary <strong>Assign</strong> is that these allow numbers and strings as keys.</p>
</div>
<div class="content"><div class='highlight'><pre> AssignObj: [
o <span class="hljs-string">'ObjAssignable'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>
o <span class="hljs-string">'ObjAssignable : Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">3</span>, <span class="hljs-string">'object'</span>,
operatorToken: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'ObjAssignable :
INDENT Expression OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">4</span>, <span class="hljs-string">'object'</span>,
operatorToken: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'SimpleObjAssignable = Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">3</span>, <span class="hljs-literal">null</span>,
operatorToken: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'SimpleObjAssignable =
INDENT Expression OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">4</span>, <span class="hljs-literal">null</span>,
operatorToken: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'Comment'</span>
]
SimpleObjAssignable: [
o <span class="hljs-string">'Identifier'</span>
o <span class="hljs-string">'Property'</span>
o <span class="hljs-string">'ThisProperty'</span>
]
ObjAssignable: [
o <span class="hljs-string">'SimpleObjAssignable'</span>
o <span class="hljs-string">'AlphaNumeric'</span>
]</pre></div></div>
</li>
<li id="section-22">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-22">¶</a>
</div>
<p>A return statement from a function body.</p>
</div>
<div class="content"><div class='highlight'><pre> Return: [
o <span class="hljs-string">'RETURN Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return $<span class="hljs-number">2</span>
o <span class="hljs-string">'RETURN INDENT Object OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return <span class="hljs-keyword">new</span> Value $<span class="hljs-number">3</span>
o <span class="hljs-string">'RETURN'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return
]
YieldReturn: [
o <span class="hljs-string">'YIELD RETURN Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> YieldReturn $<span class="hljs-number">3</span>
o <span class="hljs-string">'YIELD RETURN'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> YieldReturn
]</pre></div></div>
</li>
<li id="section-23">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-23">¶</a>
</div>
<p>A block comment.</p>
</div>
<div class="content"><div class='highlight'><pre> Comment: [
o <span class="hljs-string">'HERECOMMENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Comment $<span class="hljs-number">1</span>
]</pre></div></div>
</li>
<li id="section-24">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-24">¶</a>
</div>
<p>The <strong>Code</strong> node is the function literal. It’s defined by an indented block
of <strong>Block</strong> preceded by a function arrow, with an optional parameter
list.</p>
</div>
<div class="content"><div class='highlight'><pre> Code: [
o <span class="hljs-string">'PARAM_START ParamList PARAM_END FuncGlyph Block'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Code $<span class="hljs-number">2</span>, $<span class="hljs-number">5</span>, $<span class="hljs-number">4</span>
o <span class="hljs-string">'FuncGlyph Block'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Code [], $<span class="hljs-number">2</span>, $<span class="hljs-number">1</span>
]</pre></div></div>
</li>
<li id="section-25">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-25">¶</a>
</div>
<p>CoffeeScript has two different symbols for functions. <code>-></code> is for ordinary
functions, and <code>=></code> is for functions bound to the current value of <em>this</em>.</p>
</div>
<div class="content"><div class='highlight'><pre> FuncGlyph: [
o <span class="hljs-string">'->'</span>,
gitextract_u1pht3mv/
├── .babelrc
├── .github/
│ └── workflows/
│ └── continuous-integration.yml
├── .gitignore
├── .nojekyll
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cakefile
├── ISSUE_TEMPLATE.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── bin/
│ ├── cake
│ └── coffee
├── bower.json
├── docs/
│ ├── CNAME
│ ├── browserconfig.xml
│ ├── manifest.json
│ ├── v1/
│ │ ├── annotated-source/
│ │ │ ├── browser.html
│ │ │ ├── cake.html
│ │ │ ├── coffee-script.html
│ │ │ ├── command.html
│ │ │ ├── docco.css
│ │ │ ├── grammar.html
│ │ │ ├── helpers.html
│ │ │ ├── index.html
│ │ │ ├── lexer.html
│ │ │ ├── nodes.html
│ │ │ ├── optparse.html
│ │ │ ├── public/
│ │ │ │ └── stylesheets/
│ │ │ │ └── normalize.css
│ │ │ ├── register.html
│ │ │ ├── repl.html
│ │ │ ├── rewriter.html
│ │ │ ├── scope.html
│ │ │ └── sourcemap.html
│ │ ├── browser-compiler/
│ │ │ └── coffee-script.js
│ │ ├── index.html
│ │ └── test.html
│ └── v2/
│ ├── annotated-source/
│ │ ├── browser.html
│ │ ├── cake.html
│ │ ├── coffeescript.html
│ │ ├── command.html
│ │ ├── docco.css
│ │ ├── grammar.html
│ │ ├── helpers.html
│ │ ├── index.html
│ │ ├── lexer.html
│ │ ├── nodes.html
│ │ ├── optparse.html
│ │ ├── public/
│ │ │ └── stylesheets/
│ │ │ └── normalize.css
│ │ ├── register.html
│ │ ├── repl.html
│ │ ├── rewriter.html
│ │ ├── scope.html
│ │ └── sourcemap.html
│ ├── announcing-coffeescript-2/
│ │ └── index.html
│ ├── browser-compiler-legacy/
│ │ └── coffeescript.js
│ ├── browser-compiler-modern/
│ │ └── coffeescript.js
│ ├── index.html
│ └── test.html
├── documentation/
│ ├── examples/
│ │ ├── aliases.coffee
│ │ ├── array_comprehensions.coffee
│ │ ├── array_spread.coffee
│ │ ├── async.coffee
│ │ ├── breaking_change_bound_generator_function.coffee
│ │ ├── breaking_change_destructuring_default_values.coffee
│ │ ├── breaking_change_fat_arrow.coffee
│ │ ├── breaking_change_function_parameter_default_values.coffee
│ │ ├── breaking_change_super_in_non-class_methods_refactor_with_apply.coffee
│ │ ├── breaking_change_super_in_non-class_methods_refactor_with_class.coffee
│ │ ├── breaking_change_super_this.coffee
│ │ ├── breaking_change_super_with_arguments.coffee
│ │ ├── breaking_change_super_without_arguments.coffee
│ │ ├── cake_tasks.coffee
│ │ ├── chaining.coffee
│ │ ├── classes.coffee
│ │ ├── comment.coffee
│ │ ├── comparisons.coffee
│ │ ├── conditionals.coffee
│ │ ├── constructor_destructuring.coffee
│ │ ├── default_args.coffee
│ │ ├── do.coffee
│ │ ├── dynamic_import.coffee
│ │ ├── embedded.coffee
│ │ ├── embedded_block.coffee
│ │ ├── embedded_escaped.coffee
│ │ ├── existence.coffee
│ │ ├── existence_declared.coffee
│ │ ├── existence_undeclared.coffee
│ │ ├── expansion.coffee
│ │ ├── expressions.coffee
│ │ ├── expressions_assignment.coffee
│ │ ├── expressions_comprehension.coffee
│ │ ├── expressions_try.coffee
│ │ ├── fat_arrow.coffee
│ │ ├── functions.coffee
│ │ ├── generator_iteration.coffee
│ │ ├── generators.coffee
│ │ ├── get_set.coffee
│ │ ├── heredocs.coffee
│ │ ├── heregexes.coffee
│ │ ├── interpolation.coffee
│ │ ├── jsx.coffee
│ │ ├── modules.coffee
│ │ ├── modulo.coffee
│ │ ├── multiple_return_values.coffee
│ │ ├── object_comprehensions.coffee
│ │ ├── object_extraction.coffee
│ │ ├── object_spread.coffee
│ │ ├── objects_and_arrays.coffee
│ │ ├── objects_reserved.coffee
│ │ ├── objects_shorthand.coffee
│ │ ├── overview.coffee
│ │ ├── parallel_assignment.coffee
│ │ ├── patterns_and_splats.coffee
│ │ ├── prototypes.coffee
│ │ ├── range_comprehensions.coffee
│ │ ├── scope.coffee
│ │ ├── slices.coffee
│ │ ├── soaks.coffee
│ │ ├── splats.coffee
│ │ ├── splices.coffee
│ │ ├── static.coffee
│ │ ├── strings.coffee
│ │ ├── switch.coffee
│ │ ├── switch_with_no_expression.coffee
│ │ ├── tagged_template_literals.coffee
│ │ ├── try.coffee
│ │ ├── type_annotations.coffee
│ │ └── while.coffee
│ ├── sections/
│ │ ├── annotated_source.md
│ │ ├── announcing_coffeescript_2.md
│ │ ├── async_functions.md
│ │ ├── books.md
│ │ ├── breaking_changes.md
│ │ ├── breaking_changes_argument_parsing_and_shebang_lines.md
│ │ ├── breaking_changes_bound_generator_functions.md
│ │ ├── breaking_changes_classes.md
│ │ ├── breaking_changes_default_values.md
│ │ ├── breaking_changes_fat_arrow.md
│ │ ├── breaking_changes_jsx_and_the_less_than_and_greater_than_operators.md
│ │ ├── breaking_changes_literate_coffeescript.md
│ │ ├── breaking_changes_super_extends.md
│ │ ├── breaking_changes_super_this.md
│ │ ├── cake.md
│ │ ├── chaining.md
│ │ ├── changelog/
│ │ │ ├── 0.1.0.md
│ │ │ ├── 0.1.1.md
│ │ │ ├── 0.1.2.md
│ │ │ ├── 0.1.3.md
│ │ │ ├── 0.1.4.md
│ │ │ ├── 0.1.5.md
│ │ │ ├── 0.1.6.md
│ │ │ ├── 0.2.0.md
│ │ │ ├── 0.2.1.md
│ │ │ ├── 0.2.2.md
│ │ │ ├── 0.2.3.md
│ │ │ ├── 0.2.4.md
│ │ │ ├── 0.2.5.md
│ │ │ ├── 0.2.6.md
│ │ │ ├── 0.3.0.md
│ │ │ ├── 0.3.2.md
│ │ │ ├── 0.5.0.md
│ │ │ ├── 0.5.1.md
│ │ │ ├── 0.5.2.md
│ │ │ ├── 0.5.3.md
│ │ │ ├── 0.5.4.md
│ │ │ ├── 0.5.5.md
│ │ │ ├── 0.5.6.md
│ │ │ ├── 0.6.0.md
│ │ │ ├── 0.6.1.md
│ │ │ ├── 0.6.2.md
│ │ │ ├── 0.7.0.md
│ │ │ ├── 0.7.1.md
│ │ │ ├── 0.7.2.md
│ │ │ ├── 0.9.0.md
│ │ │ ├── 0.9.1.md
│ │ │ ├── 0.9.2.md
│ │ │ ├── 0.9.3.md
│ │ │ ├── 0.9.4.md
│ │ │ ├── 0.9.5.md
│ │ │ ├── 0.9.6.md
│ │ │ ├── 1.0.0.md
│ │ │ ├── 1.0.1.md
│ │ │ ├── 1.1.0.md
│ │ │ ├── 1.1.1.md
│ │ │ ├── 1.1.2.md
│ │ │ ├── 1.1.3.md
│ │ │ ├── 1.10.0.md
│ │ │ ├── 1.11.0.md
│ │ │ ├── 1.11.1.md
│ │ │ ├── 1.12.0.md
│ │ │ ├── 1.12.1.md
│ │ │ ├── 1.12.2.md
│ │ │ ├── 1.12.3.md
│ │ │ ├── 1.12.4.md
│ │ │ ├── 1.12.5.md
│ │ │ ├── 1.12.6.md
│ │ │ ├── 1.12.7.md
│ │ │ ├── 1.2.0.md
│ │ │ ├── 1.3.1.md
│ │ │ ├── 1.3.3.md
│ │ │ ├── 1.4.0.md
│ │ │ ├── 1.5.0.md
│ │ │ ├── 1.6.1.md
│ │ │ ├── 1.6.2.md
│ │ │ ├── 1.6.3.md
│ │ │ ├── 1.7.0.md
│ │ │ ├── 1.7.1.md
│ │ │ ├── 1.8.0.md
│ │ │ ├── 1.9.0.md
│ │ │ ├── 1.9.1.md
│ │ │ ├── 1.9.2.md
│ │ │ ├── 1.9.3.md
│ │ │ ├── 2.0.0-alpha1.md
│ │ │ ├── 2.0.0-beta1.md
│ │ │ ├── 2.0.0-beta2.md
│ │ │ ├── 2.0.0-beta3.md
│ │ │ ├── 2.0.0-beta4.md
│ │ │ ├── 2.0.0-beta5.md
│ │ │ ├── 2.0.0.md
│ │ │ ├── 2.0.1.md
│ │ │ ├── 2.0.2.md
│ │ │ ├── 2.0.3.md
│ │ │ ├── 2.1.0.md
│ │ │ ├── 2.1.1.md
│ │ │ ├── 2.2.0.md
│ │ │ ├── 2.2.1.md
│ │ │ ├── 2.2.2.md
│ │ │ ├── 2.2.3.md
│ │ │ ├── 2.2.4.md
│ │ │ ├── 2.3.0.md
│ │ │ ├── 2.3.1.md
│ │ │ ├── 2.3.2.md
│ │ │ ├── 2.4.0.md
│ │ │ ├── 2.4.1.md
│ │ │ ├── 2.5.0.md
│ │ │ ├── 2.5.1.md
│ │ │ ├── 2.6.0.md
│ │ │ ├── 2.6.1.md
│ │ │ └── 2.7.0.md
│ │ ├── changelog.md
│ │ ├── chat.md
│ │ ├── classes.md
│ │ ├── coffeescript_2.md
│ │ ├── command_line_interface.md
│ │ ├── comments.md
│ │ ├── comparisons.md
│ │ ├── compatibility.md
│ │ ├── conditionals.md
│ │ ├── contributing.md
│ │ ├── destructuring.md
│ │ ├── embedded.md
│ │ ├── examples.md
│ │ ├── existential_operator.md
│ │ ├── expressions.md
│ │ ├── fat_arrow.md
│ │ ├── functions.md
│ │ ├── generators.md
│ │ ├── heregexes.md
│ │ ├── installation.md
│ │ ├── integrations.md
│ │ ├── integrations_build_tools.md
│ │ ├── integrations_code_editors.md
│ │ ├── integrations_frameworks.md
│ │ ├── integrations_linters_and_formatting.md
│ │ ├── integrations_testing.md
│ │ ├── introduction.md
│ │ ├── jsx.md
│ │ ├── language.md
│ │ ├── lexical_scope.md
│ │ ├── literate.md
│ │ ├── loops.md
│ │ ├── modules.md
│ │ ├── nodejs_usage.md
│ │ ├── objects_and_arrays.md
│ │ ├── operators.md
│ │ ├── overview.md
│ │ ├── prototypal_inheritance.md
│ │ ├── resources.md
│ │ ├── screencasts.md
│ │ ├── scripts.md
│ │ ├── slices.md
│ │ ├── source_maps.md
│ │ ├── splats.md
│ │ ├── strings.md
│ │ ├── switch.md
│ │ ├── tagged_template_literals.md
│ │ ├── test.md
│ │ ├── transpilation.md
│ │ ├── try.md
│ │ ├── type_annotations.md
│ │ ├── unsupported.md
│ │ ├── unsupported_get_set.md
│ │ ├── unsupported_let_const.md
│ │ ├── unsupported_named_functions.md
│ │ ├── usage.md
│ │ └── whats_new_in_coffeescript_2.md
│ └── site/
│ ├── body.html
│ ├── code.coffee
│ ├── code.css
│ ├── code.html
│ ├── docs.coffee
│ ├── docs.css
│ ├── index.html
│ ├── navbar.html
│ ├── scripts.html
│ ├── sidebar.html
│ ├── styles.html
│ ├── test.html
│ └── try.html
├── lib/
│ ├── coffeescript/
│ │ ├── browser.js
│ │ ├── cake.js
│ │ ├── coffeescript.js
│ │ ├── command.js
│ │ ├── grammar.js
│ │ ├── helpers.js
│ │ ├── index.js
│ │ ├── lexer.js
│ │ ├── nodes.js
│ │ ├── optparse.js
│ │ ├── parser.js
│ │ ├── register.js
│ │ ├── repl.js
│ │ ├── rewriter.js
│ │ ├── scope.js
│ │ └── sourcemap.js
│ ├── coffeescript-browser-compiler-legacy/
│ │ └── coffeescript.js
│ └── coffeescript-browser-compiler-modern/
│ └── coffeescript.js
├── package.json
├── register.js
├── repl.js
├── src/
│ ├── browser.coffee
│ ├── cake.coffee
│ ├── coffeescript.coffee
│ ├── command.coffee
│ ├── grammar.coffee
│ ├── helpers.coffee
│ ├── index.coffee
│ ├── lexer.coffee
│ ├── nodes.coffee
│ ├── optparse.coffee
│ ├── register.coffee
│ ├── repl.coffee
│ ├── rewriter.coffee
│ ├── scope.litcoffee
│ └── sourcemap.litcoffee
└── test/
├── abstract_syntax_tree.coffee
├── abstract_syntax_tree_location_data.coffee
├── argument_parsing.coffee
├── arrays.coffee
├── assignment.coffee
├── async.coffee
├── async_iterators.coffee
├── booleans.coffee
├── classes.coffee
├── cluster.coffee
├── comments.coffee
├── compilation.coffee
├── comprehensions.coffee
├── control_flow.coffee
├── error_messages.coffee
├── eval.coffee
├── exception_handling.coffee
├── exponentiation.coffee
├── formatting.coffee
├── function_invocation.coffee
├── functions.coffee
├── generators.coffee
├── helpers.coffee
├── import_assertions.coffee
├── importing/
│ ├── .coffee
│ ├── .coffee.md
│ ├── .import.coffee
│ ├── .import.coffee.md
│ ├── .import2
│ ├── error.coffee
│ ├── import.coffee
│ ├── import.coffee.md
│ ├── import.extension.coffee
│ ├── import.extension.coffee.md
│ ├── import.extension.js
│ ├── import.js
│ ├── import.litcoffee
│ ├── import.unknownextension
│ ├── import2
│ ├── index.coffee.md
│ ├── shebang.coffee
│ ├── shebang_extra_args.coffee
│ ├── shebang_initial_space.coffee
│ ├── shebang_initial_space_extra_args.coffee
│ └── transpile_import.coffee
├── importing.coffee
├── interpolation.coffee
├── invocation_argument_parsing.coffee
├── javascript_literals.coffee
├── jsx.coffee
├── literate.litcoffee
├── literate_tabbed.litcoffee
├── location.coffee
├── modules.coffee
├── numbers.coffee
├── numbers_bigint.coffee
├── numeric_literal_separators.coffee
├── object_rest_spread.coffee
├── objects.coffee
├── operators.coffee
├── option_parser.coffee
├── package.coffee
├── parser.coffee
├── ranges.coffee
├── regex.coffee
├── regex_dotall.coffee
├── repl.coffee
├── scope.coffee
├── slicing_and_splicing.coffee
├── soaks.coffee
├── sourcemap.coffee
├── strict.coffee
├── strings.coffee
├── support/
│ └── helpers.coffee
└── tagged_template_literals.coffee
SYMBOL INDEX (1268 symbols across 12 files)
FILE: docs/v1/browser-compiler/coffee-script.js
function u (line 16) | function u(e){return u[e]}
function n (line 24) | function n(){}
function a (line 42) | function a(){}
function e (line 79) | function e(){this.yy={}}
function e (line 252) | function e(e,a,b,r){var f,k;this.parent=e;this.expressions=a;this.method...
function l (line 257) | function l(){this.constructor=a}
function a (line 258) | function a(a,b){var d;this.code=""+b;this.locationData=null!=a?a.locatio...
function b (line 259) | function b(){}
function b (line 265) | function b(a){this.expressions=ea(ia(a||[]))}
function b (line 271) | function b(a){this.value=a}
function b (line 272) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 272) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 272) | function b(){b.__super__.constructor.call(this,
function b (line 273) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 273) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 273) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 274) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 274) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 274) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 275) | function b(){b.__super__.constructor.call(this,"this")}
function b (line 275) | function b(){b.__super__.constructor.call(this,"undefined")}
function b (line 276) | function b(){b.__super__.constructor.call(this,"null")}
function b (line 276) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 276) | function b(a){this.expression=a}
function b (line 277) | function b(){return b.__super__.constructor.apply(this,
function m (line 278) | function m(a,b,Ca){if(!b&&a instanceof m)return a;this.base=a;this.prope...
function b (line 285) | function b(a){this.comment=a}
function b (line 285) | function b(a,b,m){this.variable=
function b (line 292) | function b(a){b.__super__.constructor.call(this,null,null!=a?a:[new T(ne...
function b (line 294) | function b(a){null==a&&(a=[]);b.__super__.constructor.call(this,new C(ne...
function m (line 294) | function m(b,d,c){d instanceof D&&(d=new A(a.wrap([new C(d)])));m.__supe...
function b (line 295) | function b(a,b){this.child=a;this.parent=b}
function b (line 295) | function b(a,b){this.name=a;this.soak="soak"===b}
function b (line 296) | function b(a){this.index=a}
function b (line 297) | function b(a,b,c){this.from=a;this.to=b;this.equals=(this.exclusive="exc...
function b (line 302) | function b(a){this.range=a;b.__super__.constructor.call(this)}
function b (line 303) | function b(a,b){this.generated=null!=b?b:!1;this.objects=this.properties...
function b (line 306) | function b(a){this.objects=a||[]}
function c (line 308) | function c(b,d,c){this.variable=b;this.parent=d;this.body=null!=c?c:new ...
function b (line 315) | function b(a,b){this.clause=a;this.source=b;this.checkSource()}
function b (line 316) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 317) | function b(a,b){this.defaultBinding=a;this.namedImports=b}
function c (line 317) | function c(){return c.__super__.constructor.apply(this,
function b (line 319) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 319) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 319) | function b(){return b.__super__.constructor.apply(this,
function b (line 320) | function b(a){this.specifiers=a}
function b (line 321) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 321) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 321) | function b(a,b,c){this.original=a;this.alias=b;this.moduleDeclarationTyp...
function b (line 322) | function b(a,d){b.__super__.constructor.call(this,a,d,"import")}
function b (line 323) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 323) | function b(){return b.__super__.constructor.apply(this,arguments)}
function b (line 323) | function b(a,d){b.__super__.constructor.call(this,a,d,"export")}
function b (line 323) | function b(a,b,c,e){this.variable=a;this.value=b;this.context=
function c (line 335) | function c(b,d,c){this.params=b||[];this.body=d||new a;this.bound="bound...
function b (line 341) | function b(a,b,c){this.name=a;this.value=b;this.splat=c;(a=Aa(this.name....
function b (line 343) | function b(a){this.name=a.compile?a:new B(a)}
function b (line 346) | function b(){return b.__super__.constructor.apply(this,arguments)}
function c (line 346) | function c(a,b){this.condition=null!=b&&b.invert?a.invert():a;
function b (line 349) | function b(a,b,d,e){if("in"===a)return new O(b,d);if("do"===a)return thi...
function b (line 359) | function b(a,b){this.object=a;this.array=b}
function b (line 361) | function b(a,b,c,e){this.attempt=a;this.errorVariable=b;this.recovery=c;...
function b (line 364) | function b(a){this.expression=a}
function b (line 364) | function b(a){this.expression=
function b (line 366) | function b(a){this.body=a}
function b (line 367) | function b(){return b.__super__.constructor.apply(this,arguments)}
function c (line 368) | function c(b,d){this.source=d.source;this.guard=d.guard;this.step=d.step...
function c (line 376) | function c(a,b,c){this.subject=a;this.cases=b;this.otherwise=c}
function c (line 379) | function c(a,b,c){this.body=b;null==c&&(c={});this.condition="unless"===...
function e (line 387) | function e(e){this.line=e;this.columns=[]}
function e (line 387) | function e(){this.lines=[]}
FILE: docs/v2/browser-compiler-legacy/coffeescript.js
function _get (line 8) | function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Ref...
function _superPropBase (line 8) | function _superPropBase(object,property){for(;!Object.prototype.hasOwnPr...
function _inherits (line 8) | function _inherits(subClass,superClass){if("function"!=typeof superClass...
function _setPrototypeOf (line 8) | function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototype...
function _createSuper (line 8) | function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeRe...
function _possibleConstructorReturn (line 8) | function _possibleConstructorReturn(self,call){if(call&&("object"===_typ...
function _assertThisInitialized (line 8) | function _assertThisInitialized(self){if(void 0===self)throw new Referen...
function _isNativeReflectConstruct (line 8) | function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Re...
function _getPrototypeOf (line 8) | function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf...
function _toArray (line 8) | function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr...
function _slicedToArray (line 8) | function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToA...
function _nonIterableRest (line 8) | function _nonIterableRest(){throw new TypeError("Invalid attempt to dest...
function _iterableToArrayLimit (line 8) | function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!...
function _arrayWithHoles (line 8) | function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}
function _classCallCheck (line 8) | function _classCallCheck(instance,Constructor){if(!(instance instanceof ...
function _defineProperties (line 8) | function _defineProperties(target,props){for(var i=0,descriptor;i<props....
function _createClass (line 8) | function _createClass(Constructor,protoProps,staticProps){return protoPr...
function _typeof (line 8) | function _typeof(obj){"@babel/helpers - typeof";return _typeof="function...
function _toConsumableArray (line 8) | function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterab...
function _nonIterableSpread (line 8) | function _nonIterableSpread(){throw new TypeError("Invalid attempt to sp...
function _unsupportedIterableToArray (line 8) | function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof...
function _iterableToArray (line 8) | function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=ite...
function _arrayWithoutHoles (line 8) | function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLike...
function _arrayLikeToArray (line 8) | function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=ar...
function require (line 8) | function require(path){return require[path]}
function Rewriter (line 8) | function Rewriter(){_classCallCheck(this,Rewriter)}
function Lexer (line 8) | function Lexer(){_classCallCheck(this,Lexer),this.error=this.error.bind(...
function Parser (line 8) | function Parser(){this.yy={}}
function Scope (line 8) | function Scope(parent,expressions,method,referencedVars){_classCallCheck...
function CodeFragment (line 8) | function CodeFragment(parent,code){_classCallCheck(this,CodeFragment);va...
function Base (line 8) | function Base(){_classCallCheck(this,Base)}
function HoistTarget (line 8) | function HoistTarget(source1){var _this8;return _classCallCheck(this,Hoi...
function Root (line 8) | function Root(body1){var _this9;return _classCallCheck(this,Root),_this9...
function Block (line 8) | function Block(nodes){var _this10;return _classCallCheck(this,Block),_th...
function Directive (line 8) | function Directive(value1){var _this11;return _classCallCheck(this,Direc...
function Literal (line 8) | function Literal(value1){var _this12;return _classCallCheck(this,Literal...
function NumberLiteral (line 8) | function NumberLiteral(value1){var _ref22=1<arguments.length&&void 0!==a...
function InfinityLiteral (line 8) | function InfinityLiteral(value1){var _ref23=1<arguments.length&&void 0!=...
function NaNLiteral (line 8) | function NaNLiteral(){return _classCallCheck(this,NaNLiteral),_super8.ca...
function StringLiteral (line 8) | function StringLiteral(originalValue){var _ref24=1<arguments.length&&voi...
function RegexLiteral (line 8) | function RegexLiteral(value){var _ref25=1<arguments.length&&void 0!==arg...
function PassthroughLiteral (line 8) | function PassthroughLiteral(originalValue){var _ref26=1<arguments.length...
function IdentifierLiteral (line 8) | function IdentifierLiteral(){return _classCallCheck(this,IdentifierLiter...
function PropertyName (line 8) | function PropertyName(){return _classCallCheck(this,PropertyName),_super...
function ComputedPropertyName (line 8) | function ComputedPropertyName(){return _classCallCheck(this,ComputedProp...
function StatementLiteral (line 8) | function StatementLiteral(){return _classCallCheck(this,StatementLiteral...
function ThisLiteral (line 8) | function ThisLiteral(value){var _this18;return _classCallCheck(this,This...
function UndefinedLiteral (line 8) | function UndefinedLiteral(){return _classCallCheck(this,UndefinedLiteral...
function NullLiteral (line 8) | function NullLiteral(){return _classCallCheck(this,NullLiteral),_super18...
function BooleanLiteral (line 8) | function BooleanLiteral(value){var _ref27=1<arguments.length&&void 0!==a...
function DefaultLiteral (line 8) | function DefaultLiteral(){return _classCallCheck(this,DefaultLiteral),_s...
function Return (line 8) | function Return(expression1){var _ref28=1<arguments.length&&void 0!==arg...
function FuncDirectiveReturn (line 8) | function FuncDirectiveReturn(expression,_ref29){var returnKeyword=_ref29...
function YieldReturn (line 8) | function YieldReturn(){return _classCallCheck(this,YieldReturn),_super23...
function AwaitReturn (line 8) | function AwaitReturn(){return _classCallCheck(this,AwaitReturn),_super24...
function Value (line 8) | function Value(base,props,tag){var isDefaultValue=!!(3<arguments.length&...
function MetaProperty (line 8) | function MetaProperty(meta,property1){var _this24;return _classCallCheck...
function HereComment (line 8) | function HereComment(_ref31){var content1=_ref31.content,newLine=_ref31....
function LineComment (line 8) | function LineComment(_ref32){var content1=_ref32.content,newLine=_ref32....
function JSXIdentifier (line 8) | function JSXIdentifier(){return _classCallCheck(this,JSXIdentifier),_sup...
function JSXTag (line 8) | function JSXTag(value,_ref33){var tagNameLocationData=_ref33.tagNameLoca...
function JSXExpressionContainer (line 8) | function JSXExpressionContainer(expression1){var _ref34=1<arguments.leng...
function JSXEmptyExpression (line 8) | function JSXEmptyExpression(){return _classCallCheck(this,JSXEmptyExpres...
function JSXText (line 8) | function JSXText(stringLiteral){var _this29;return _classCallCheck(this,...
function JSXAttribute (line 8) | function JSXAttribute(_ref35){var name1=_ref35.name,value=_ref35.value,_...
function JSXAttributes (line 8) | function JSXAttributes(arr){var _this31;_classCallCheck(this,JSXAttribut...
function JSXNamespacedName (line 8) | function JSXNamespacedName(tag){var _this32;_classCallCheck(this,JSXName...
function JSXElement (line 8) | function JSXElement(_ref36){var tagName1=_ref36.tagName,attributes=_ref3...
function Call (line 8) | function Call(variable1){var args1=1<arguments.length&&void 0!==argument...
function SuperCall (line 8) | function SuperCall(){return _classCallCheck(this,SuperCall),_super39.app...
function Super (line 8) | function Super(accessor,superLiteral){var _this36;return _classCallCheck...
function RegexWithInterpolations (line 8) | function RegexWithInterpolations(call1){var _ref37=1<arguments.length&&v...
function TaggedTemplateCall (line 8) | function TaggedTemplateCall(variable,arg,soak){return _classCallCheck(th...
function Extends (line 8) | function Extends(child1,parent1){var _this38;return _classCallCheck(this...
function Access (line 8) | function Access(name1){var _ref38=1<arguments.length&&void 0!==arguments...
function Index (line 8) | function Index(index1){var _this40;return _classCallCheck(this,Index),_t...
function Range (line 8) | function Range(from1,to1,tag){var _this41;return _classCallCheck(this,Ra...
function Slice (line 8) | function Slice(range1){var _this42;return _classCallCheck(this,Slice),_t...
function Obj (line 8) | function Obj(props){var generated=!!(1<arguments.length&&void 0!==argume...
function ObjectProperty (line 8) | function ObjectProperty(_ref40){var key=_ref40.key,fromAssign=_ref40.fro...
function Arr (line 8) | function Arr(objs){var lhs1=!!(1<arguments.length&&void 0!==arguments[1]...
function Class (line 8) | function Class(variable1,parent1,body1){var _this46;return _classCallChe...
function ExecutableClassBody (line 8) | function ExecutableClassBody(_class){var body1=1<arguments.length&&void ...
function ClassProperty (line 8) | function ClassProperty(_ref44){var name1=_ref44.name,isStatic=_ref44.isS...
function ClassPrototypeProperty (line 8) | function ClassPrototypeProperty(_ref45){var name1=_ref45.name,value1=_re...
function ModuleDeclaration (line 8) | function ModuleDeclaration(clause,source1,assertions){var _this52;return...
function ImportDeclaration (line 8) | function ImportDeclaration(){return _classCallCheck(this,ImportDeclarati...
function ImportClause (line 8) | function ImportClause(defaultBinding,namedImports){var _this53;return _c...
function ExportDeclaration (line 8) | function ExportDeclaration(){return _classCallCheck(this,ExportDeclarati...
function ExportNamedDeclaration (line 8) | function ExportNamedDeclaration(){return _classCallCheck(this,ExportName...
function ExportDefaultDeclaration (line 8) | function ExportDefaultDeclaration(){return _classCallCheck(this,ExportDe...
function ExportAllDeclaration (line 8) | function ExportAllDeclaration(){return _classCallCheck(this,ExportAllDec...
function ModuleSpecifierList (line 8) | function ModuleSpecifierList(specifiers){var _this54;return _classCallCh...
function ImportSpecifierList (line 8) | function ImportSpecifierList(){return _classCallCheck(this,ImportSpecifi...
function ExportSpecifierList (line 8) | function ExportSpecifierList(){return _classCallCheck(this,ExportSpecifi...
function ModuleSpecifier (line 8) | function ModuleSpecifier(original,alias,moduleDeclarationType1){var _thi...
function ImportSpecifier (line 8) | function ImportSpecifier(imported,local){return _classCallCheck(this,Imp...
function ImportDefaultSpecifier (line 8) | function ImportDefaultSpecifier(){return _classCallCheck(this,ImportDefa...
function ImportNamespaceSpecifier (line 8) | function ImportNamespaceSpecifier(){return _classCallCheck(this,ImportNa...
function ExportSpecifier (line 8) | function ExportSpecifier(local,exported){return _classCallCheck(this,Exp...
function DynamicImport (line 8) | function DynamicImport(){return _classCallCheck(this,DynamicImport),_sup...
function DynamicImportCall (line 8) | function DynamicImportCall(){return _classCallCheck(this,DynamicImportCa...
function Assign (line 8) | function Assign(variable1,value1,context1){var options=3<arguments.lengt...
function FuncGlyph (line 8) | function FuncGlyph(glyph){var _this59;return _classCallCheck(this,FuncGl...
function Code (line 8) | function Code(params,body,funcGlyph,paramStart){var _this60;_classCallCh...
function Param (line 8) | function Param(name1,value1,splat1){var _this65;_classCallCheck(this,Par...
function Splat (line 8) | function Splat(name){var _ref52=1<arguments.length&&void 0!==arguments[1...
function Expansion (line 8) | function Expansion(){return _classCallCheck(this,Expansion),_super77.app...
function Elision (line 8) | function Elision(){return _classCallCheck(this,Elision),_super78.apply(t...
function While (line 8) | function While(condition1){var _ref54=1<arguments.length&&void 0!==argum...
function Op (line 8) | function Op(op,first,second,flip){var _ref55=4<arguments.length&&void 0!...
function In (line 8) | function In(object1,array){var _this70;return _classCallCheck(this,In),_...
function Try (line 8) | function Try(attempt,_catch,ensure,finallyTag){var _this71;return _class...
function Catch (line 8) | function Catch(recovery,errorVariable){var _this72;_classCallCheck(this,...
function Throw (line 8) | function Throw(expression1){var _this73;return _classCallCheck(this,Thro...
function Existence (line 8) | function Existence(expression1){var onlyNotUndefined=!!(1<arguments.leng...
function Parens (line 8) | function Parens(body1){var _this75;return _classCallCheck(this,Parens),_...
function StringWithInterpolations (line 8) | function StringWithInterpolations(body1){var _ref60=1<arguments.length&&...
function TemplateElement (line 8) | function TemplateElement(value1){var _ref64=1<arguments.length&&void 0!=...
function Interpolation (line 8) | function Interpolation(expression1){var _this78;return _classCallCheck(t...
function EmptyInterpolation (line 8) | function EmptyInterpolation(){return _classCallCheck(this,EmptyInterpola...
function For (line 8) | function For(body,source){var _this79;return _classCallCheck(this,For),_...
function Switch (line 8) | function Switch(subject,cases1,otherwise){var _this81;return _classCallC...
function SwitchCase (line 8) | function SwitchCase(test1,block1){var _ref66=2<arguments.length&&void 0!...
function SwitchWhen (line 8) | function SwitchWhen(conditions1,block1){var _this83;return _classCallChe...
function If (line 8) | function If(condition1,body1){var options=2<arguments.length&&void 0!==a...
function Sequence (line 8) | function Sequence(expressions1){var _this85;return _classCallCheck(this,...
function LineMap (line 8) | function LineMap(line1){_classCallCheck(this,LineMap),this.line=line1,th...
function SourceMap (line 8) | function SourceMap(){_classCallCheck(this,SourceMap),this.lines=[]}
FILE: docs/v2/browser-compiler-modern/coffeescript.js
function _get (line 8) | function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Ref...
function _superPropBase (line 8) | function _superPropBase(object,property){for(;!Object.prototype.hasOwnPr...
function _inherits (line 8) | function _inherits(subClass,superClass){if("function"!=typeof superClass...
function _setPrototypeOf (line 8) | function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototype...
function _createSuper (line 8) | function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeRe...
function _possibleConstructorReturn (line 8) | function _possibleConstructorReturn(self,call){if(call&&("object"===_typ...
function _assertThisInitialized (line 8) | function _assertThisInitialized(self){if(void 0===self)throw new Referen...
function _isNativeReflectConstruct (line 8) | function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Re...
function _getPrototypeOf (line 8) | function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf...
function _toArray (line 8) | function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr...
function _slicedToArray (line 8) | function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToA...
function _nonIterableRest (line 8) | function _nonIterableRest(){throw new TypeError("Invalid attempt to dest...
function _iterableToArrayLimit (line 8) | function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!...
function _arrayWithHoles (line 8) | function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}
function _classCallCheck (line 8) | function _classCallCheck(instance,Constructor){if(!(instance instanceof ...
function _defineProperties (line 8) | function _defineProperties(target,props){for(var i=0,descriptor;i<props....
function _createClass (line 8) | function _createClass(Constructor,protoProps,staticProps){return protoPr...
function _typeof (line 8) | function _typeof(obj){"@babel/helpers - typeof";return _typeof="function...
function _toConsumableArray (line 8) | function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterab...
function _nonIterableSpread (line 8) | function _nonIterableSpread(){throw new TypeError("Invalid attempt to sp...
function _unsupportedIterableToArray (line 8) | function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof...
function _iterableToArray (line 8) | function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=ite...
function _arrayWithoutHoles (line 8) | function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLike...
function _arrayLikeToArray (line 8) | function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=ar...
function require (line 8) | function require(path){return require[path]}
function Rewriter (line 8) | function Rewriter(){_classCallCheck(this,Rewriter)}
function Lexer (line 8) | function Lexer(){_classCallCheck(this,Lexer),this.error=this.error.bind(...
function Parser (line 8) | function Parser(){this.yy={}}
function Scope (line 8) | function Scope(parent,expressions,method,referencedVars){_classCallCheck...
function CodeFragment (line 8) | function CodeFragment(parent,code){_classCallCheck(this,CodeFragment);va...
function Base (line 8) | function Base(){_classCallCheck(this,Base)}
function HoistTarget (line 8) | function HoistTarget(source1){var _this8;return _classCallCheck(this,Hoi...
function Root (line 8) | function Root(body1){var _this9;return _classCallCheck(this,Root),_this9...
function Block (line 8) | function Block(nodes){var _this10;return _classCallCheck(this,Block),_th...
function Directive (line 8) | function Directive(value1){var _this11;return _classCallCheck(this,Direc...
function Literal (line 8) | function Literal(value1){var _this12;return _classCallCheck(this,Literal...
function NumberLiteral (line 8) | function NumberLiteral(value1){var _ref22=1<arguments.length&&void 0!==a...
function InfinityLiteral (line 8) | function InfinityLiteral(value1){var _ref23=1<arguments.length&&void 0!=...
function NaNLiteral (line 8) | function NaNLiteral(){return _classCallCheck(this,NaNLiteral),_super8.ca...
function StringLiteral (line 8) | function StringLiteral(originalValue){var _ref24=1<arguments.length&&voi...
function RegexLiteral (line 8) | function RegexLiteral(value){var _ref25=1<arguments.length&&void 0!==arg...
function PassthroughLiteral (line 8) | function PassthroughLiteral(originalValue){var _ref26=1<arguments.length...
function IdentifierLiteral (line 8) | function IdentifierLiteral(){return _classCallCheck(this,IdentifierLiter...
function PropertyName (line 8) | function PropertyName(){return _classCallCheck(this,PropertyName),_super...
function ComputedPropertyName (line 8) | function ComputedPropertyName(){return _classCallCheck(this,ComputedProp...
function StatementLiteral (line 8) | function StatementLiteral(){return _classCallCheck(this,StatementLiteral...
function ThisLiteral (line 8) | function ThisLiteral(value){var _this18;return _classCallCheck(this,This...
function UndefinedLiteral (line 8) | function UndefinedLiteral(){return _classCallCheck(this,UndefinedLiteral...
function NullLiteral (line 8) | function NullLiteral(){return _classCallCheck(this,NullLiteral),_super18...
function BooleanLiteral (line 8) | function BooleanLiteral(value){var _ref27=1<arguments.length&&void 0!==a...
function DefaultLiteral (line 8) | function DefaultLiteral(){return _classCallCheck(this,DefaultLiteral),_s...
function Return (line 8) | function Return(expression1){var _ref28=1<arguments.length&&void 0!==arg...
function FuncDirectiveReturn (line 8) | function FuncDirectiveReturn(expression,_ref29){var returnKeyword=_ref29...
function YieldReturn (line 8) | function YieldReturn(){return _classCallCheck(this,YieldReturn),_super23...
function AwaitReturn (line 8) | function AwaitReturn(){return _classCallCheck(this,AwaitReturn),_super24...
function Value (line 8) | function Value(base,props,tag){var isDefaultValue=!!(3<arguments.length&...
function MetaProperty (line 8) | function MetaProperty(meta,property1){var _this24;return _classCallCheck...
function HereComment (line 8) | function HereComment(_ref31){var content1=_ref31.content,newLine=_ref31....
function LineComment (line 8) | function LineComment(_ref32){var content1=_ref32.content,newLine=_ref32....
function JSXIdentifier (line 8) | function JSXIdentifier(){return _classCallCheck(this,JSXIdentifier),_sup...
function JSXTag (line 8) | function JSXTag(value,_ref33){var tagNameLocationData=_ref33.tagNameLoca...
function JSXExpressionContainer (line 8) | function JSXExpressionContainer(expression1){var _ref34=1<arguments.leng...
function JSXEmptyExpression (line 8) | function JSXEmptyExpression(){return _classCallCheck(this,JSXEmptyExpres...
function JSXText (line 8) | function JSXText(stringLiteral){var _this29;return _classCallCheck(this,...
function JSXAttribute (line 8) | function JSXAttribute(_ref35){var name1=_ref35.name,value=_ref35.value,_...
function JSXAttributes (line 8) | function JSXAttributes(arr){var _this31;_classCallCheck(this,JSXAttribut...
function JSXNamespacedName (line 8) | function JSXNamespacedName(tag){var _this32;_classCallCheck(this,JSXName...
function JSXElement (line 8) | function JSXElement(_ref36){var tagName1=_ref36.tagName,attributes=_ref3...
function Call (line 8) | function Call(variable1){var args1=1<arguments.length&&void 0!==argument...
function SuperCall (line 8) | function SuperCall(){return _classCallCheck(this,SuperCall),_super39.app...
function Super (line 8) | function Super(accessor,superLiteral){var _this36;return _classCallCheck...
function RegexWithInterpolations (line 8) | function RegexWithInterpolations(call1){var _ref37=1<arguments.length&&v...
function TaggedTemplateCall (line 8) | function TaggedTemplateCall(variable,arg,soak){return _classCallCheck(th...
function Extends (line 8) | function Extends(child1,parent1){var _this38;return _classCallCheck(this...
function Access (line 8) | function Access(name1){var _ref38=1<arguments.length&&void 0!==arguments...
function Index (line 8) | function Index(index1){var _this40;return _classCallCheck(this,Index),_t...
function Range (line 8) | function Range(from1,to1,tag){var _this41;return _classCallCheck(this,Ra...
function Slice (line 8) | function Slice(range1){var _this42;return _classCallCheck(this,Slice),_t...
function Obj (line 8) | function Obj(props){var generated=!!(1<arguments.length&&void 0!==argume...
function ObjectProperty (line 8) | function ObjectProperty(_ref40){var key=_ref40.key,fromAssign=_ref40.fro...
function Arr (line 8) | function Arr(objs){var lhs1=!!(1<arguments.length&&void 0!==arguments[1]...
function Class (line 8) | function Class(variable1,parent1,body1){var _this46;return _classCallChe...
function ExecutableClassBody (line 8) | function ExecutableClassBody(_class){var body1=1<arguments.length&&void ...
function ClassProperty (line 8) | function ClassProperty(_ref44){var name1=_ref44.name,isStatic=_ref44.isS...
function ClassPrototypeProperty (line 8) | function ClassPrototypeProperty(_ref45){var name1=_ref45.name,value1=_re...
function ModuleDeclaration (line 8) | function ModuleDeclaration(clause,source1,assertions){var _this52;return...
function ImportDeclaration (line 8) | function ImportDeclaration(){return _classCallCheck(this,ImportDeclarati...
function ImportClause (line 8) | function ImportClause(defaultBinding,namedImports){var _this53;return _c...
function ExportDeclaration (line 8) | function ExportDeclaration(){return _classCallCheck(this,ExportDeclarati...
function ExportNamedDeclaration (line 8) | function ExportNamedDeclaration(){return _classCallCheck(this,ExportName...
function ExportDefaultDeclaration (line 8) | function ExportDefaultDeclaration(){return _classCallCheck(this,ExportDe...
function ExportAllDeclaration (line 8) | function ExportAllDeclaration(){return _classCallCheck(this,ExportAllDec...
function ModuleSpecifierList (line 8) | function ModuleSpecifierList(specifiers){var _this54;return _classCallCh...
function ImportSpecifierList (line 8) | function ImportSpecifierList(){return _classCallCheck(this,ImportSpecifi...
function ExportSpecifierList (line 8) | function ExportSpecifierList(){return _classCallCheck(this,ExportSpecifi...
function ModuleSpecifier (line 8) | function ModuleSpecifier(original,alias,moduleDeclarationType1){var _thi...
function ImportSpecifier (line 8) | function ImportSpecifier(imported,local){return _classCallCheck(this,Imp...
function ImportDefaultSpecifier (line 8) | function ImportDefaultSpecifier(){return _classCallCheck(this,ImportDefa...
function ImportNamespaceSpecifier (line 8) | function ImportNamespaceSpecifier(){return _classCallCheck(this,ImportNa...
function ExportSpecifier (line 8) | function ExportSpecifier(local,exported){return _classCallCheck(this,Exp...
function DynamicImport (line 8) | function DynamicImport(){return _classCallCheck(this,DynamicImport),_sup...
function DynamicImportCall (line 8) | function DynamicImportCall(){return _classCallCheck(this,DynamicImportCa...
function Assign (line 8) | function Assign(variable1,value1,context1){var options=3<arguments.lengt...
function FuncGlyph (line 8) | function FuncGlyph(glyph){var _this59;return _classCallCheck(this,FuncGl...
function Code (line 8) | function Code(params,body,funcGlyph,paramStart){var _this60;_classCallCh...
function Param (line 8) | function Param(name1,value1,splat1){var _this65;_classCallCheck(this,Par...
function Splat (line 8) | function Splat(name){var _ref52=1<arguments.length&&void 0!==arguments[1...
function Expansion (line 8) | function Expansion(){return _classCallCheck(this,Expansion),_super77.app...
function Elision (line 8) | function Elision(){return _classCallCheck(this,Elision),_super78.apply(t...
function While (line 8) | function While(condition1){var _ref54=1<arguments.length&&void 0!==argum...
function Op (line 8) | function Op(op,first,second,flip){var _ref55=4<arguments.length&&void 0!...
function In (line 8) | function In(object1,array){var _this70;return _classCallCheck(this,In),_...
function Try (line 8) | function Try(attempt,_catch,ensure,finallyTag){var _this71;return _class...
function Catch (line 8) | function Catch(recovery,errorVariable){var _this72;_classCallCheck(this,...
function Throw (line 8) | function Throw(expression1){var _this73;return _classCallCheck(this,Thro...
function Existence (line 8) | function Existence(expression1){var onlyNotUndefined=!!(1<arguments.leng...
function Parens (line 8) | function Parens(body1){var _this75;return _classCallCheck(this,Parens),_...
function StringWithInterpolations (line 8) | function StringWithInterpolations(body1){var _ref60=1<arguments.length&&...
function TemplateElement (line 8) | function TemplateElement(value1){var _ref64=1<arguments.length&&void 0!=...
function Interpolation (line 8) | function Interpolation(expression1){var _this78;return _classCallCheck(t...
function EmptyInterpolation (line 8) | function EmptyInterpolation(){return _classCallCheck(this,EmptyInterpola...
function For (line 8) | function For(body,source){var _this79;return _classCallCheck(this,For),_...
function Switch (line 8) | function Switch(subject,cases1,otherwise){var _this81;return _classCallC...
function SwitchCase (line 8) | function SwitchCase(test1,block1){var _ref66=2<arguments.length&&void 0!...
function SwitchWhen (line 8) | function SwitchWhen(conditions1,block1){var _this83;return _classCallChe...
function If (line 8) | function If(condition1,body1){var options=2<arguments.length&&void 0!==a...
function Sequence (line 8) | function Sequence(expressions1){var _this85;return _classCallCheck(this,...
function LineMap (line 8) | function LineMap(line1){_classCallCheck(this,LineMap),this.line=line1,th...
function SourceMap (line 8) | function SourceMap(){_classCallCheck(this,SourceMap),this.lines=[]}
FILE: lib/coffeescript-browser-compiler-legacy/coffeescript.js
function _get (line 8) | function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Ref...
function _superPropBase (line 8) | function _superPropBase(object,property){for(;!Object.prototype.hasOwnPr...
function _inherits (line 8) | function _inherits(subClass,superClass){if("function"!=typeof superClass...
function _setPrototypeOf (line 8) | function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototype...
function _createSuper (line 8) | function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeRe...
function _possibleConstructorReturn (line 8) | function _possibleConstructorReturn(self,call){if(call&&("object"===_typ...
function _assertThisInitialized (line 8) | function _assertThisInitialized(self){if(void 0===self)throw new Referen...
function _isNativeReflectConstruct (line 8) | function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Re...
function _getPrototypeOf (line 8) | function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf...
function _toArray (line 8) | function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr...
function _slicedToArray (line 8) | function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToA...
function _nonIterableRest (line 8) | function _nonIterableRest(){throw new TypeError("Invalid attempt to dest...
function _iterableToArrayLimit (line 8) | function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!...
function _arrayWithHoles (line 8) | function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}
function _classCallCheck (line 8) | function _classCallCheck(instance,Constructor){if(!(instance instanceof ...
function _defineProperties (line 8) | function _defineProperties(target,props){for(var i=0,descriptor;i<props....
function _createClass (line 8) | function _createClass(Constructor,protoProps,staticProps){return protoPr...
function _typeof (line 8) | function _typeof(obj){"@babel/helpers - typeof";return _typeof="function...
function _toConsumableArray (line 8) | function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterab...
function _nonIterableSpread (line 8) | function _nonIterableSpread(){throw new TypeError("Invalid attempt to sp...
function _unsupportedIterableToArray (line 8) | function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof...
function _iterableToArray (line 8) | function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=ite...
function _arrayWithoutHoles (line 8) | function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLike...
function _arrayLikeToArray (line 8) | function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=ar...
function require (line 8) | function require(path){return require[path]}
function Rewriter (line 8) | function Rewriter(){_classCallCheck(this,Rewriter)}
function Lexer (line 8) | function Lexer(){_classCallCheck(this,Lexer),this.error=this.error.bind(...
function Parser (line 8) | function Parser(){this.yy={}}
function Scope (line 8) | function Scope(parent,expressions,method,referencedVars){_classCallCheck...
function CodeFragment (line 8) | function CodeFragment(parent,code){_classCallCheck(this,CodeFragment);va...
function Base (line 8) | function Base(){_classCallCheck(this,Base)}
function HoistTarget (line 8) | function HoistTarget(source1){var _this8;return _classCallCheck(this,Hoi...
function Root (line 8) | function Root(body1){var _this9;return _classCallCheck(this,Root),_this9...
function Block (line 8) | function Block(nodes){var _this10;return _classCallCheck(this,Block),_th...
function Directive (line 8) | function Directive(value1){var _this11;return _classCallCheck(this,Direc...
function Literal (line 8) | function Literal(value1){var _this12;return _classCallCheck(this,Literal...
function NumberLiteral (line 8) | function NumberLiteral(value1){var _ref22=1<arguments.length&&void 0!==a...
function InfinityLiteral (line 8) | function InfinityLiteral(value1){var _ref23=1<arguments.length&&void 0!=...
function NaNLiteral (line 8) | function NaNLiteral(){return _classCallCheck(this,NaNLiteral),_super8.ca...
function StringLiteral (line 8) | function StringLiteral(originalValue){var _ref24=1<arguments.length&&voi...
function RegexLiteral (line 8) | function RegexLiteral(value){var _ref25=1<arguments.length&&void 0!==arg...
function PassthroughLiteral (line 8) | function PassthroughLiteral(originalValue){var _ref26=1<arguments.length...
function IdentifierLiteral (line 8) | function IdentifierLiteral(){return _classCallCheck(this,IdentifierLiter...
function PropertyName (line 8) | function PropertyName(){return _classCallCheck(this,PropertyName),_super...
function ComputedPropertyName (line 8) | function ComputedPropertyName(){return _classCallCheck(this,ComputedProp...
function StatementLiteral (line 8) | function StatementLiteral(){return _classCallCheck(this,StatementLiteral...
function ThisLiteral (line 8) | function ThisLiteral(value){var _this18;return _classCallCheck(this,This...
function UndefinedLiteral (line 8) | function UndefinedLiteral(){return _classCallCheck(this,UndefinedLiteral...
function NullLiteral (line 8) | function NullLiteral(){return _classCallCheck(this,NullLiteral),_super18...
function BooleanLiteral (line 8) | function BooleanLiteral(value){var _ref27=1<arguments.length&&void 0!==a...
function DefaultLiteral (line 8) | function DefaultLiteral(){return _classCallCheck(this,DefaultLiteral),_s...
function Return (line 8) | function Return(expression1){var _ref28=1<arguments.length&&void 0!==arg...
function FuncDirectiveReturn (line 8) | function FuncDirectiveReturn(expression,_ref29){var returnKeyword=_ref29...
function YieldReturn (line 8) | function YieldReturn(){return _classCallCheck(this,YieldReturn),_super23...
function AwaitReturn (line 8) | function AwaitReturn(){return _classCallCheck(this,AwaitReturn),_super24...
function Value (line 8) | function Value(base,props,tag){var isDefaultValue=!!(3<arguments.length&...
function MetaProperty (line 8) | function MetaProperty(meta,property1){var _this24;return _classCallCheck...
function HereComment (line 8) | function HereComment(_ref31){var content1=_ref31.content,newLine=_ref31....
function LineComment (line 8) | function LineComment(_ref32){var content1=_ref32.content,newLine=_ref32....
function JSXIdentifier (line 8) | function JSXIdentifier(){return _classCallCheck(this,JSXIdentifier),_sup...
function JSXTag (line 8) | function JSXTag(value,_ref33){var tagNameLocationData=_ref33.tagNameLoca...
function JSXExpressionContainer (line 8) | function JSXExpressionContainer(expression1){var _ref34=1<arguments.leng...
function JSXEmptyExpression (line 8) | function JSXEmptyExpression(){return _classCallCheck(this,JSXEmptyExpres...
function JSXText (line 8) | function JSXText(stringLiteral){var _this29;return _classCallCheck(this,...
function JSXAttribute (line 8) | function JSXAttribute(_ref35){var name1=_ref35.name,value=_ref35.value,_...
function JSXAttributes (line 8) | function JSXAttributes(arr){var _this31;_classCallCheck(this,JSXAttribut...
function JSXNamespacedName (line 8) | function JSXNamespacedName(tag){var _this32;_classCallCheck(this,JSXName...
function JSXElement (line 8) | function JSXElement(_ref36){var tagName1=_ref36.tagName,attributes=_ref3...
function Call (line 8) | function Call(variable1){var args1=1<arguments.length&&void 0!==argument...
function SuperCall (line 8) | function SuperCall(){return _classCallCheck(this,SuperCall),_super39.app...
function Super (line 8) | function Super(accessor,superLiteral){var _this36;return _classCallCheck...
function RegexWithInterpolations (line 8) | function RegexWithInterpolations(call1){var _ref37=1<arguments.length&&v...
function TaggedTemplateCall (line 8) | function TaggedTemplateCall(variable,arg,soak){return _classCallCheck(th...
function Extends (line 8) | function Extends(child1,parent1){var _this38;return _classCallCheck(this...
function Access (line 8) | function Access(name1){var _ref38=1<arguments.length&&void 0!==arguments...
function Index (line 8) | function Index(index1){var _this40;return _classCallCheck(this,Index),_t...
function Range (line 8) | function Range(from1,to1,tag){var _this41;return _classCallCheck(this,Ra...
function Slice (line 8) | function Slice(range1){var _this42;return _classCallCheck(this,Slice),_t...
function Obj (line 8) | function Obj(props){var generated=!!(1<arguments.length&&void 0!==argume...
function ObjectProperty (line 8) | function ObjectProperty(_ref40){var key=_ref40.key,fromAssign=_ref40.fro...
function Arr (line 8) | function Arr(objs){var lhs1=!!(1<arguments.length&&void 0!==arguments[1]...
function Class (line 8) | function Class(variable1,parent1,body1){var _this46;return _classCallChe...
function ExecutableClassBody (line 8) | function ExecutableClassBody(_class){var body1=1<arguments.length&&void ...
function ClassProperty (line 8) | function ClassProperty(_ref44){var name1=_ref44.name,isStatic=_ref44.isS...
function ClassPrototypeProperty (line 8) | function ClassPrototypeProperty(_ref45){var name1=_ref45.name,value1=_re...
function ModuleDeclaration (line 8) | function ModuleDeclaration(clause,source1,assertions){var _this52;return...
function ImportDeclaration (line 8) | function ImportDeclaration(){return _classCallCheck(this,ImportDeclarati...
function ImportClause (line 8) | function ImportClause(defaultBinding,namedImports){var _this53;return _c...
function ExportDeclaration (line 8) | function ExportDeclaration(){return _classCallCheck(this,ExportDeclarati...
function ExportNamedDeclaration (line 8) | function ExportNamedDeclaration(){return _classCallCheck(this,ExportName...
function ExportDefaultDeclaration (line 8) | function ExportDefaultDeclaration(){return _classCallCheck(this,ExportDe...
function ExportAllDeclaration (line 8) | function ExportAllDeclaration(){return _classCallCheck(this,ExportAllDec...
function ModuleSpecifierList (line 8) | function ModuleSpecifierList(specifiers){var _this54;return _classCallCh...
function ImportSpecifierList (line 8) | function ImportSpecifierList(){return _classCallCheck(this,ImportSpecifi...
function ExportSpecifierList (line 8) | function ExportSpecifierList(){return _classCallCheck(this,ExportSpecifi...
function ModuleSpecifier (line 8) | function ModuleSpecifier(original,alias,moduleDeclarationType1){var _thi...
function ImportSpecifier (line 8) | function ImportSpecifier(imported,local){return _classCallCheck(this,Imp...
function ImportDefaultSpecifier (line 8) | function ImportDefaultSpecifier(){return _classCallCheck(this,ImportDefa...
function ImportNamespaceSpecifier (line 8) | function ImportNamespaceSpecifier(){return _classCallCheck(this,ImportNa...
function ExportSpecifier (line 8) | function ExportSpecifier(local,exported){return _classCallCheck(this,Exp...
function DynamicImport (line 8) | function DynamicImport(){return _classCallCheck(this,DynamicImport),_sup...
function DynamicImportCall (line 8) | function DynamicImportCall(){return _classCallCheck(this,DynamicImportCa...
function Assign (line 8) | function Assign(variable1,value1,context1){var options=3<arguments.lengt...
function FuncGlyph (line 8) | function FuncGlyph(glyph){var _this59;return _classCallCheck(this,FuncGl...
function Code (line 8) | function Code(params,body,funcGlyph,paramStart){var _this60;_classCallCh...
function Param (line 8) | function Param(name1,value1,splat1){var _this65;_classCallCheck(this,Par...
function Splat (line 8) | function Splat(name){var _ref52=1<arguments.length&&void 0!==arguments[1...
function Expansion (line 8) | function Expansion(){return _classCallCheck(this,Expansion),_super77.app...
function Elision (line 8) | function Elision(){return _classCallCheck(this,Elision),_super78.apply(t...
function While (line 8) | function While(condition1){var _ref54=1<arguments.length&&void 0!==argum...
function Op (line 8) | function Op(op,first,second,flip){var _ref55=4<arguments.length&&void 0!...
function In (line 8) | function In(object1,array){var _this70;return _classCallCheck(this,In),_...
function Try (line 8) | function Try(attempt,_catch,ensure,finallyTag){var _this71;return _class...
function Catch (line 8) | function Catch(recovery,errorVariable){var _this72;_classCallCheck(this,...
function Throw (line 8) | function Throw(expression1){var _this73;return _classCallCheck(this,Thro...
function Existence (line 8) | function Existence(expression1){var onlyNotUndefined=!!(1<arguments.leng...
function Parens (line 8) | function Parens(body1){var _this75;return _classCallCheck(this,Parens),_...
function StringWithInterpolations (line 8) | function StringWithInterpolations(body1){var _ref60=1<arguments.length&&...
function TemplateElement (line 8) | function TemplateElement(value1){var _ref64=1<arguments.length&&void 0!=...
function Interpolation (line 8) | function Interpolation(expression1){var _this78;return _classCallCheck(t...
function EmptyInterpolation (line 8) | function EmptyInterpolation(){return _classCallCheck(this,EmptyInterpola...
function For (line 8) | function For(body,source){var _this79;return _classCallCheck(this,For),_...
function Switch (line 8) | function Switch(subject,cases1,otherwise){var _this81;return _classCallC...
function SwitchCase (line 8) | function SwitchCase(test1,block1){var _ref66=2<arguments.length&&void 0!...
function SwitchWhen (line 8) | function SwitchWhen(conditions1,block1){var _this83;return _classCallChe...
function If (line 8) | function If(condition1,body1){var options=2<arguments.length&&void 0!==a...
function Sequence (line 8) | function Sequence(expressions1){var _this85;return _classCallCheck(this,...
function LineMap (line 8) | function LineMap(line1){_classCallCheck(this,LineMap),this.line=line1,th...
function SourceMap (line 8) | function SourceMap(){_classCallCheck(this,SourceMap),this.lines=[]}
FILE: lib/coffeescript-browser-compiler-modern/coffeescript.js
function _get (line 8) | function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Ref...
function _superPropBase (line 8) | function _superPropBase(object,property){for(;!Object.prototype.hasOwnPr...
function _inherits (line 8) | function _inherits(subClass,superClass){if("function"!=typeof superClass...
function _setPrototypeOf (line 8) | function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototype...
function _createSuper (line 8) | function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeRe...
function _possibleConstructorReturn (line 8) | function _possibleConstructorReturn(self,call){if(call&&("object"===_typ...
function _assertThisInitialized (line 8) | function _assertThisInitialized(self){if(void 0===self)throw new Referen...
function _isNativeReflectConstruct (line 8) | function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Re...
function _getPrototypeOf (line 8) | function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf...
function _toArray (line 8) | function _toArray(arr){return _arrayWithHoles(arr)||_iterableToArray(arr...
function _slicedToArray (line 8) | function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToA...
function _nonIterableRest (line 8) | function _nonIterableRest(){throw new TypeError("Invalid attempt to dest...
function _iterableToArrayLimit (line 8) | function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!...
function _arrayWithHoles (line 8) | function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}
function _classCallCheck (line 8) | function _classCallCheck(instance,Constructor){if(!(instance instanceof ...
function _defineProperties (line 8) | function _defineProperties(target,props){for(var i=0,descriptor;i<props....
function _createClass (line 8) | function _createClass(Constructor,protoProps,staticProps){return protoPr...
function _typeof (line 8) | function _typeof(obj){"@babel/helpers - typeof";return _typeof="function...
function _toConsumableArray (line 8) | function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterab...
function _nonIterableSpread (line 8) | function _nonIterableSpread(){throw new TypeError("Invalid attempt to sp...
function _unsupportedIterableToArray (line 8) | function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof...
function _iterableToArray (line 8) | function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=ite...
function _arrayWithoutHoles (line 8) | function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLike...
function _arrayLikeToArray (line 8) | function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=ar...
function require (line 8) | function require(path){return require[path]}
function Rewriter (line 8) | function Rewriter(){_classCallCheck(this,Rewriter)}
function Lexer (line 8) | function Lexer(){_classCallCheck(this,Lexer),this.error=this.error.bind(...
function Parser (line 8) | function Parser(){this.yy={}}
function Scope (line 8) | function Scope(parent,expressions,method,referencedVars){_classCallCheck...
function CodeFragment (line 8) | function CodeFragment(parent,code){_classCallCheck(this,CodeFragment);va...
function Base (line 8) | function Base(){_classCallCheck(this,Base)}
function HoistTarget (line 8) | function HoistTarget(source1){var _this8;return _classCallCheck(this,Hoi...
function Root (line 8) | function Root(body1){var _this9;return _classCallCheck(this,Root),_this9...
function Block (line 8) | function Block(nodes){var _this10;return _classCallCheck(this,Block),_th...
function Directive (line 8) | function Directive(value1){var _this11;return _classCallCheck(this,Direc...
function Literal (line 8) | function Literal(value1){var _this12;return _classCallCheck(this,Literal...
function NumberLiteral (line 8) | function NumberLiteral(value1){var _ref22=1<arguments.length&&void 0!==a...
function InfinityLiteral (line 8) | function InfinityLiteral(value1){var _ref23=1<arguments.length&&void 0!=...
function NaNLiteral (line 8) | function NaNLiteral(){return _classCallCheck(this,NaNLiteral),_super8.ca...
function StringLiteral (line 8) | function StringLiteral(originalValue){var _ref24=1<arguments.length&&voi...
function RegexLiteral (line 8) | function RegexLiteral(value){var _ref25=1<arguments.length&&void 0!==arg...
function PassthroughLiteral (line 8) | function PassthroughLiteral(originalValue){var _ref26=1<arguments.length...
function IdentifierLiteral (line 8) | function IdentifierLiteral(){return _classCallCheck(this,IdentifierLiter...
function PropertyName (line 8) | function PropertyName(){return _classCallCheck(this,PropertyName),_super...
function ComputedPropertyName (line 8) | function ComputedPropertyName(){return _classCallCheck(this,ComputedProp...
function StatementLiteral (line 8) | function StatementLiteral(){return _classCallCheck(this,StatementLiteral...
function ThisLiteral (line 8) | function ThisLiteral(value){var _this18;return _classCallCheck(this,This...
function UndefinedLiteral (line 8) | function UndefinedLiteral(){return _classCallCheck(this,UndefinedLiteral...
function NullLiteral (line 8) | function NullLiteral(){return _classCallCheck(this,NullLiteral),_super18...
function BooleanLiteral (line 8) | function BooleanLiteral(value){var _ref27=1<arguments.length&&void 0!==a...
function DefaultLiteral (line 8) | function DefaultLiteral(){return _classCallCheck(this,DefaultLiteral),_s...
function Return (line 8) | function Return(expression1){var _ref28=1<arguments.length&&void 0!==arg...
function FuncDirectiveReturn (line 8) | function FuncDirectiveReturn(expression,_ref29){var returnKeyword=_ref29...
function YieldReturn (line 8) | function YieldReturn(){return _classCallCheck(this,YieldReturn),_super23...
function AwaitReturn (line 8) | function AwaitReturn(){return _classCallCheck(this,AwaitReturn),_super24...
function Value (line 8) | function Value(base,props,tag){var isDefaultValue=!!(3<arguments.length&...
function MetaProperty (line 8) | function MetaProperty(meta,property1){var _this24;return _classCallCheck...
function HereComment (line 8) | function HereComment(_ref31){var content1=_ref31.content,newLine=_ref31....
function LineComment (line 8) | function LineComment(_ref32){var content1=_ref32.content,newLine=_ref32....
function JSXIdentifier (line 8) | function JSXIdentifier(){return _classCallCheck(this,JSXIdentifier),_sup...
function JSXTag (line 8) | function JSXTag(value,_ref33){var tagNameLocationData=_ref33.tagNameLoca...
function JSXExpressionContainer (line 8) | function JSXExpressionContainer(expression1){var _ref34=1<arguments.leng...
function JSXEmptyExpression (line 8) | function JSXEmptyExpression(){return _classCallCheck(this,JSXEmptyExpres...
function JSXText (line 8) | function JSXText(stringLiteral){var _this29;return _classCallCheck(this,...
function JSXAttribute (line 8) | function JSXAttribute(_ref35){var name1=_ref35.name,value=_ref35.value,_...
function JSXAttributes (line 8) | function JSXAttributes(arr){var _this31;_classCallCheck(this,JSXAttribut...
function JSXNamespacedName (line 8) | function JSXNamespacedName(tag){var _this32;_classCallCheck(this,JSXName...
function JSXElement (line 8) | function JSXElement(_ref36){var tagName1=_ref36.tagName,attributes=_ref3...
function Call (line 8) | function Call(variable1){var args1=1<arguments.length&&void 0!==argument...
function SuperCall (line 8) | function SuperCall(){return _classCallCheck(this,SuperCall),_super39.app...
function Super (line 8) | function Super(accessor,superLiteral){var _this36;return _classCallCheck...
function RegexWithInterpolations (line 8) | function RegexWithInterpolations(call1){var _ref37=1<arguments.length&&v...
function TaggedTemplateCall (line 8) | function TaggedTemplateCall(variable,arg,soak){return _classCallCheck(th...
function Extends (line 8) | function Extends(child1,parent1){var _this38;return _classCallCheck(this...
function Access (line 8) | function Access(name1){var _ref38=1<arguments.length&&void 0!==arguments...
function Index (line 8) | function Index(index1){var _this40;return _classCallCheck(this,Index),_t...
function Range (line 8) | function Range(from1,to1,tag){var _this41;return _classCallCheck(this,Ra...
function Slice (line 8) | function Slice(range1){var _this42;return _classCallCheck(this,Slice),_t...
function Obj (line 8) | function Obj(props){var generated=!!(1<arguments.length&&void 0!==argume...
function ObjectProperty (line 8) | function ObjectProperty(_ref40){var key=_ref40.key,fromAssign=_ref40.fro...
function Arr (line 8) | function Arr(objs){var lhs1=!!(1<arguments.length&&void 0!==arguments[1]...
function Class (line 8) | function Class(variable1,parent1,body1){var _this46;return _classCallChe...
function ExecutableClassBody (line 8) | function ExecutableClassBody(_class){var body1=1<arguments.length&&void ...
function ClassProperty (line 8) | function ClassProperty(_ref44){var name1=_ref44.name,isStatic=_ref44.isS...
function ClassPrototypeProperty (line 8) | function ClassPrototypeProperty(_ref45){var name1=_ref45.name,value1=_re...
function ModuleDeclaration (line 8) | function ModuleDeclaration(clause,source1,assertions){var _this52;return...
function ImportDeclaration (line 8) | function ImportDeclaration(){return _classCallCheck(this,ImportDeclarati...
function ImportClause (line 8) | function ImportClause(defaultBinding,namedImports){var _this53;return _c...
function ExportDeclaration (line 8) | function ExportDeclaration(){return _classCallCheck(this,ExportDeclarati...
function ExportNamedDeclaration (line 8) | function ExportNamedDeclaration(){return _classCallCheck(this,ExportName...
function ExportDefaultDeclaration (line 8) | function ExportDefaultDeclaration(){return _classCallCheck(this,ExportDe...
function ExportAllDeclaration (line 8) | function ExportAllDeclaration(){return _classCallCheck(this,ExportAllDec...
function ModuleSpecifierList (line 8) | function ModuleSpecifierList(specifiers){var _this54;return _classCallCh...
function ImportSpecifierList (line 8) | function ImportSpecifierList(){return _classCallCheck(this,ImportSpecifi...
function ExportSpecifierList (line 8) | function ExportSpecifierList(){return _classCallCheck(this,ExportSpecifi...
function ModuleSpecifier (line 8) | function ModuleSpecifier(original,alias,moduleDeclarationType1){var _thi...
function ImportSpecifier (line 8) | function ImportSpecifier(imported,local){return _classCallCheck(this,Imp...
function ImportDefaultSpecifier (line 8) | function ImportDefaultSpecifier(){return _classCallCheck(this,ImportDefa...
function ImportNamespaceSpecifier (line 8) | function ImportNamespaceSpecifier(){return _classCallCheck(this,ImportNa...
function ExportSpecifier (line 8) | function ExportSpecifier(local,exported){return _classCallCheck(this,Exp...
function DynamicImport (line 8) | function DynamicImport(){return _classCallCheck(this,DynamicImport),_sup...
function DynamicImportCall (line 8) | function DynamicImportCall(){return _classCallCheck(this,DynamicImportCa...
function Assign (line 8) | function Assign(variable1,value1,context1){var options=3<arguments.lengt...
function FuncGlyph (line 8) | function FuncGlyph(glyph){var _this59;return _classCallCheck(this,FuncGl...
function Code (line 8) | function Code(params,body,funcGlyph,paramStart){var _this60;_classCallCh...
function Param (line 8) | function Param(name1,value1,splat1){var _this65;_classCallCheck(this,Par...
function Splat (line 8) | function Splat(name){var _ref52=1<arguments.length&&void 0!==arguments[1...
function Expansion (line 8) | function Expansion(){return _classCallCheck(this,Expansion),_super77.app...
function Elision (line 8) | function Elision(){return _classCallCheck(this,Elision),_super78.apply(t...
function While (line 8) | function While(condition1){var _ref54=1<arguments.length&&void 0!==argum...
function Op (line 8) | function Op(op,first,second,flip){var _ref55=4<arguments.length&&void 0!...
function In (line 8) | function In(object1,array){var _this70;return _classCallCheck(this,In),_...
function Try (line 8) | function Try(attempt,_catch,ensure,finallyTag){var _this71;return _class...
function Catch (line 8) | function Catch(recovery,errorVariable){var _this72;_classCallCheck(this,...
function Throw (line 8) | function Throw(expression1){var _this73;return _classCallCheck(this,Thro...
function Existence (line 8) | function Existence(expression1){var onlyNotUndefined=!!(1<arguments.leng...
function Parens (line 8) | function Parens(body1){var _this75;return _classCallCheck(this,Parens),_...
function StringWithInterpolations (line 8) | function StringWithInterpolations(body1){var _ref60=1<arguments.length&&...
function TemplateElement (line 8) | function TemplateElement(value1){var _ref64=1<arguments.length&&void 0!=...
function Interpolation (line 8) | function Interpolation(expression1){var _this78;return _classCallCheck(t...
function EmptyInterpolation (line 8) | function EmptyInterpolation(){return _classCallCheck(this,EmptyInterpola...
function For (line 8) | function For(body,source){var _this79;return _classCallCheck(this,For),_...
function Switch (line 8) | function Switch(subject,cases1,otherwise){var _this81;return _classCallC...
function SwitchCase (line 8) | function SwitchCase(test1,block1){var _ref66=2<arguments.length&&void 0!...
function SwitchWhen (line 8) | function SwitchWhen(conditions1,block1){var _this83;return _classCallChe...
function If (line 8) | function If(condition1,body1){var options=2<arguments.length&&void 0!==a...
function Sequence (line 8) | function Sequence(expressions1){var _this85;return _classCallCheck(this,...
function LineMap (line 8) | function LineMap(line1){_classCallCheck(this,LineMap),this.line=line1,th...
function SourceMap (line 8) | function SourceMap(){_classCallCheck(this,SourceMap),this.lines=[]}
FILE: lib/coffeescript/lexer.js
method constructor (line 29) | constructor() {
method tokenize (line 45) | tokenize(code, opts = {}) {
method clean (line 98) | clean(code) {
method identifierToken (line 133) | identifierToken() {
method numberToken (line 307) | numberToken() {
method stringToken (line 345) | stringToken() {
method commentToken (line 418) | commentToken(chunk = this.chunk, {heregex, returnCommentTokens = false, ...
method jsToken (line 553) | jsToken() {
method regexToken (line 574) | regexToken() {
method lineToken (line 719) | lineToken({chunk = this.chunk, offset = 0} = {}) {
method outdentToken (line 809) | outdentToken({moveOut, noNewlines, outdentLength = 0, offset = 0, indent...
method whitespaceToken (line 857) | whitespaceToken() {
method newlineToken (line 874) | newlineToken(offset) {
method suppressNewlines (line 887) | suppressNewlines() {
method jsxToken (line 902) | jsxToken() {
method atJSXTag (line 1087) | atJSXTag(depth = 0) {
method literalToken (line 1105) | literalToken() {
method tagParameters (line 1215) | tagParameters() {
method tagDoIife (line 1248) | tagDoIife(tokenIndex) {
method closeIndentation (line 1259) | closeIndentation() {
method matchWithInterpolations (line 1285) | matchWithInterpolations(regex, delimiter, closingDelimiter = delimiter, ...
method mergeInterpolationTokens (line 1380) | mergeInterpolationTokens(tokens, options, fn) {
method pair (line 1491) | pair(tag) {
method getLocationDataCompensation (line 1518) | getLocationDataCompensation(start, end) {
method getLineAndColumnFromChunk (line 1540) | getLineAndColumnFromChunk(offset) {
method makeLocationData (line 1569) | makeLocationData({offsetInChunk, length}) {
method makeToken (line 1586) | makeToken(tag, value, {
method token (line 1613) | token(tag, value, {offset, length, origin, data, generated, indentSize} ...
method tag (line 1624) | tag() {
method value (line 1631) | value(useOrigin = false) {
method prev (line 1642) | prev() {
method unfinished (line 1647) | unfinished() {
method validateUnicodeCodePointEscapes (line 1652) | validateUnicodeCodePointEscapes(str, options) {
method validateEscapes (line 1657) | validateEscapes(str, options = {}) {
method suppressSemicolons (line 1673) | suppressSemicolons() {
method error (line 1687) | error(message, options = {}) {
FILE: lib/coffeescript/nodes.js
method constructor (line 51) | constructor(parent, code) {
method toString (line 59) | toString() {
class Base (line 92) | class Base {
method compile (line 93) | compile(o, lvl) {
method compileWithoutComments (line 102) | compileWithoutComments(o, lvl, method = 'compile') {
method compileNodeWithoutComments (line 125) | compileNodeWithoutComments(o, lvl) {
method compileToFragments (line 135) | compileToFragments(o, lvl) {
method compileToFragmentsWithoutComments (line 148) | compileToFragmentsWithoutComments(o, lvl) {
method compileClosure (line 154) | compileClosure(o) {
method compileCommentFragments (line 187) | compileCommentFragments(o, node, fragments) {
method cache (line 264) | cache(o, level, shouldCache) {
method hoist (line 289) | hoist() {
method cacheToCodeFragments (line 304) | cacheToCodeFragments(cacheValues) {
method makeReturn (line 311) | makeReturn(results, mark) {
method contains (line 331) | contains(pred) {
method lastNode (line 344) | lastNode(list) {
method toString (line 354) | toString(idt = '', name = this.constructor.name) {
method checkForPureStatementInExpression (line 366) | checkForPureStatementInExpression() {
method ast (line 379) | ast(o, level) {
method astInitialize (line 396) | astInitialize(o, level) {
method astNode (line 413) | astNode(o) {
method astProperties (line 428) | astProperties() {
method astType (line 433) | astType() {
method astLocationData (line 439) | astLocationData() {
method isStatementAst (line 445) | isStatementAst(o) {
method eachChild (line 450) | eachChild(func) {
method traverseChildren (line 471) | traverseChildren(crossScope, func) {
method replaceInContext (line 483) | replaceInContext(match, replacement) {
method invert (line 516) | invert() {
method unwrapAll (line 520) | unwrapAll() {
method updateLocationDataIfMissing (line 531) | updateLocationDataIfMissing(locationData, force) {
method withLocationDataFrom (line 546) | withLocationDataFrom({locationData}) {
method withLocationDataAndCommentsFrom (line 551) | withLocationDataAndCommentsFrom(node) {
method error (line 562) | error(message) {
method makeCode (line 566) | makeCode(code) {
method wrapInParentheses (line 570) | wrapInParentheses(fragments) {
method wrapInBraces (line 574) | wrapInBraces(fragments) {
method joinFragmentArrays (line 581) | joinFragmentArrays(fragmentsList, joinStr) {
method expand (line 661) | static expand(fragments) {
method constructor (line 672) | constructor(source1) {
method isStatement (line 683) | isStatement(o) {
method update (line 690) | update(compile, o) {
method compileToFragments (line 695) | compileToFragments(o, level) {
method compileNode (line 701) | compileNode(o) {
method compileClosure (line 705) | compileClosure(o) {
class Root (line 715) | class Root extends Base {
method constructor (line 716) | constructor(body1) {
method compileNode (line 725) | compileNode(o) {
method initializeScope (line 739) | initializeScope(o) {
method commentsAst (line 753) | commentsAst() {
method astNode (line 782) | astNode(o) {
method astType (line 788) | astType() {
method astProperties (line 792) | astProperties(o) {
class Block (line 814) | class Block extends Base {
method constructor (line 815) | constructor(nodes) {
method push (line 821) | push(node) {
method pop (line 827) | pop() {
method unshift (line 832) | unshift(node) {
method unwrap (line 839) | unwrap() {
method isEmpty (line 848) | isEmpty() {
method isStatement (line 852) | isStatement(o) {
method jumps (line 864) | jumps(o) {
method makeReturn (line 877) | makeReturn(results, mark) {
method compile (line 912) | compile(o, lvl) {
method compileNode (line 922) | compileNode(o) {
method compileRoot (line 976) | compileRoot(o) {
method compileWithDeclarations (line 986) | compileWithDeclarations(o) {
method compileComments (line 1044) | compileComments(fragments) {
method wrap (line 1193) | static wrap(nodes) {
method astNode (line 1200) | astNode(o) {
method astType (line 1207) | astType() {
method astProperties (line 1217) | astProperties(o) {
method astLocationData (line 1263) | astLocationData() {
method constructor (line 1281) | constructor(value1) {
method astProperties (line 1286) | astProperties(o) {
class Literal (line 1302) | class Literal extends Base {
method constructor (line 1303) | constructor(value1) {
method assigns (line 1308) | assigns(name) {
method compileNode (line 1312) | compileNode(o) {
method astProperties (line 1316) | astProperties() {
method toString (line 1322) | toString() {
method constructor (line 1336) | constructor(value1, {parsedValue} = {}) {
method isBigInt (line 1350) | isBigInt() {
method astType (line 1354) | astType() {
method astProperties (line 1362) | astProperties() {
method constructor (line 1375) | constructor(value1, {originalValue: originalValue = 'Infinity'} = {}) {
method compileNode (line 1381) | compileNode() {
method astNode (line 1385) | astNode(o) {
method astType (line 1392) | astType() {
method astProperties (line 1396) | astProperties() {
method constructor (line 1406) | constructor() {
method compileNode (line 1410) | compileNode(o) {
method astType (line 1420) | astType() {
method astProperties (line 1424) | astProperties() {
method constructor (line 1434) | constructor(originalValue, {
method compileNode (line 1492) | compileNode(o) {
method withoutQuotesInLocationData (line 1508) | withoutQuotesInLocationData() {
method isFromHeredoc (line 1526) | isFromHeredoc() {
method shouldGenerateTemplateLiteral (line 1530) | shouldGenerateTemplateLiteral() {
method astNode (line 1534) | astNode(o) {
method astProperties (line 1541) | astProperties() {
class RegexLiteral (line 1553) | class RegexLiteral extends Literal {
method constructor (line 1554) | constructor(value, {delimiter: delimiter1 = '/', heregexCommentTokens:...
method astType (line 1572) | astType() {
method astProperties (line 1576) | astProperties(o) {
method constructor (line 1616) | constructor(originalValue, {here, generated} = {}) {
method astNode (line 1628) | astNode(o) {
method astProperties (line 1635) | astProperties() {
class IdentifierLiteral (line 1645) | class IdentifierLiteral extends Literal {
method eachName (line 1646) | eachName(iterator) {
method astType (line 1650) | astType() {
method astProperties (line 1658) | astProperties() {
class PropertyName (line 1674) | class PropertyName extends Literal {
method astType (line 1675) | astType() {
method astProperties (line 1683) | astProperties() {
method compileNode (line 1699) | compileNode(o) {
method astNode (line 1703) | astNode(o) {
class StatementLiteral (line 1710) | class StatementLiteral extends Literal {
method jumps (line 1711) | jumps(o) {
method compileNode (line 1720) | compileNode(o) {
method astType (line 1724) | astType() {
method constructor (line 1746) | constructor(value) {
method compileNode (line 1751) | compileNode(o) {
method astType (line 1757) | astType() {
method astProperties (line 1761) | astProperties() {
method constructor (line 1770) | constructor() {
method compileNode (line 1774) | compileNode(o) {
method astType (line 1778) | astType() {
method astProperties (line 1782) | astProperties() {
method constructor (line 1792) | constructor() {
method constructor (line 1799) | constructor(value, {originalValue} = {}) {
method astProperties (line 1807) | astProperties() {
method astType (line 1817) | astType() {
method astProperties (line 1821) | astProperties() {
class Return (line 1834) | class Return extends Base {
method constructor (line 1835) | constructor(expression1, {belongsToFuncDirectiveReturn} = {}) {
method compileToFragments (line 1841) | compileToFragments(o, level) {
method compileNode (line 1851) | compileNode(o) {
method checkForPureStatementInExpression (line 1878) | checkForPureStatementInExpression() {
method astType (line 1886) | astType() {
method astProperties (line 1890) | astProperties(o) {
class FuncDirectiveReturn (line 1913) | class FuncDirectiveReturn extends Return {
method constructor (line 1914) | constructor(expression, {returnKeyword}) {
method compileNode (line 1919) | compileNode(o) {
method checkScope (line 1924) | checkScope(o) {
method astNode (line 1930) | astNode(o) {
class YieldReturn (line 1950) | class YieldReturn extends FuncDirectiveReturn {}
class AwaitReturn (line 1959) | class AwaitReturn extends FuncDirectiveReturn {}
class Value (line 1972) | class Value extends Base {
method constructor (line 1973) | constructor(base, props, tag, isDefaultValue = false) {
method add (line 1994) | add(props) {
method hasProperties (line 2000) | hasProperties() {
method bareLiteral (line 2004) | bareLiteral(type) {
method isArray (line 2009) | isArray() {
method isRange (line 2013) | isRange() {
method shouldCache (line 2017) | shouldCache() {
method isAssignable (line 2021) | isAssignable(opts) {
method isNumber (line 2025) | isNumber() {
method isString (line 2029) | isString() {
method isRegex (line 2033) | isRegex() {
method isUndefined (line 2037) | isUndefined() {
method isNull (line 2041) | isNull() {
method isBoolean (line 2045) | isBoolean() {
method isAtomic (line 2049) | isAtomic() {
method isNotCallable (line 2061) | isNotCallable() {
method isStatement (line 2065) | isStatement(o) {
method isJSXTag (line 2069) | isJSXTag() {
method assigns (line 2073) | assigns(name) {
method jumps (line 2077) | jumps(o) {
method isObject (line 2081) | isObject(onlyGenerated) {
method isElision (line 2088) | isElision() {
method isSplice (line 2095) | isSplice() {
method looksStatic (line 2101) | looksStatic(className) {
method unwrap (line 2113) | unwrap() {
method cacheReference (line 2124) | cacheReference(o) {
method compileNode (line 2150) | compileNode(o) {
method unfoldSoak (line 2176) | unfoldSoak(o) {
method eachName (line 2206) | eachName(iterator, {checkAssignability = true} = {}) {
method object (line 2218) | object() {
method containsSoak (line 2240) | containsSoak() {
method astNode (line 2258) | astNode(o) {
method astType (line 2269) | astType() {
method astProperties (line 2282) | astProperties(o) {
method astLocationData (line 2298) | astLocationData() {
class MetaProperty (line 2315) | class MetaProperty extends Base {
method constructor (line 2316) | constructor(meta, property1) {
method checkValid (line 2322) | checkValid(o) {
method compileNode (line 2338) | compileNode(o) {
method astProperties (line 2347) | astProperties(o) {
method constructor (line 2367) | constructor({
method compileNode (line 2380) | compileNode(o) {
method astType (line 2412) | astType() {
method astProperties (line 2416) | astProperties() {
method constructor (line 2428) | constructor({
method compileNode (line 2443) | compileNode(o) {
method astType (line 2454) | astType() {
method astProperties (line 2458) | astProperties() {
method astType (line 2468) | astType() {
method constructor (line 2475) | constructor(value, {tagNameLocationData, closingTagOpeningBracketLocatio...
method astProperties (line 2484) | astProperties() {
class JSXExpressionContainer (line 2493) | class JSXExpressionContainer extends Base {
method constructor (line 2494) | constructor(expression1, {locationData} = {}) {
method compileNode (line 2501) | compileNode(o) {
method astProperties (line 2505) | astProperties(o) {
method constructor (line 2522) | constructor(stringLiteral) {
method astProperties (line 2528) | astProperties() {
class JSXAttribute (line 2540) | class JSXAttribute extends Base {
method constructor (line 2541) | constructor({
method compileNode (line 2554) | compileNode(o) {
method astProperties (line 2564) | astProperties(o) {
class JSXAttributes (line 2585) | class JSXAttributes extends Base {
method constructor (line 2586) | constructor(arr) {
method checkValidAttribute (line 2627) | checkValidAttribute(object) {
method compileNode (line 2638) | compileNode(o) {
method astNode (line 2650) | astNode(o) {
class JSXNamespacedName (line 2670) | class JSXNamespacedName extends Base {
method constructor (line 2671) | constructor(tag) {
method astProperties (line 2684) | astProperties(o) {
class JSXElement (line 2701) | class JSXElement extends Base {
method constructor (line 2702) | constructor({
method compileNode (line 2713) | compileNode(o) {
method isFragment (line 2731) | isFragment() {
method astNode (line 2735) | astNode(o) {
method astType (line 2748) | astType() {
method elementAstProperties (line 2756) | elementAstProperties(o) {
method fragmentAstProperties (line 2813) | fragmentAstProperties(o) {
method contentAst (line 2824) | contentAst(o) {
method astProperties (line 2882) | astProperties(o) {
method astLocationData (line 2888) | astLocationData() {
class Call (line 2908) | class Call extends Base {
method constructor (line 2909) | constructor(variable1, args1 = [], soak1, token1) {
method updateLocationDataIfMissing (line 2940) | updateLocationDataIfMissing(locationData) {
method newInstance (line 2963) | newInstance() {
method unfoldSoak (line 2976) | unfoldSoak(o) {
method compileNode (line 3030) | compileNode(o) {
method checkForNewSuper (line 3080) | checkForNewSuper() {
method containsSoak (line 3088) | containsSoak() {
method astNode (line 3099) | astNode(o) {
method astType (line 3108) | astType() {
method astProperties (line 3118) | astProperties(o) {
class SuperCall (line 3153) | class SuperCall extends Call {
method isStatement (line 3154) | isStatement(o) {
method compileNode (line 3159) | compileNode(o) {
class Super (line 3184) | class Super extends Base {
method constructor (line 3185) | constructor(accessor, superLiteral) {
method compileNode (line 3191) | compileNode(o) {
method checkInInstanceMethod (line 3222) | checkInInstanceMethod(o) {
method astNode (line 3230) | astNode(o) {
class RegexWithInterpolations (line 3252) | class RegexWithInterpolations extends Base {
method constructor (line 3253) | constructor(call1, {heregexCommentTokens: heregexCommentTokens = []} =...
method compileNode (line 3259) | compileNode(o) {
method astType (line 3263) | astType() {
method astProperties (line 3267) | astProperties(o) {
method constructor (line 3299) | constructor(variable, arg, soak) {
method compileNode (line 3306) | compileNode(o) {
method astType (line 3310) | astType() {
method astProperties (line 3314) | astProperties(o) {
class Extends (line 3329) | class Extends extends Base {
method constructor (line 3330) | constructor(child1, parent1) {
method compileToFragments (line 3337) | compileToFragments(o) {
class Access (line 3354) | class Access extends Base {
method constructor (line 3355) | constructor(name1, {
method compileToFragments (line 3365) | compileToFragments(o) {
method astNode (line 3376) | astNode(o) {
class Index (line 3397) | class Index extends Base {
method constructor (line 3398) | constructor(index1) {
method compileToFragments (line 3403) | compileToFragments(o) {
method shouldCache (line 3407) | shouldCache() {
method astNode (line 3411) | astNode(o) {
class Range (line 3434) | class Range extends Base {
method constructor (line 3435) | constructor(from1, to1, tag) {
method compileVariables (line 3445) | compileVariables(o) {
method compileNode (line 3463) | compileNode(o) {
method compileArray (line 3506) | compileArray(o) {
method astProperties (line 3547) | astProperties(o) {
class Slice (line 3570) | class Slice extends Base {
method constructor (line 3571) | constructor(range1) {
method compileNode (line 3579) | compileNode(o) {
method astNode (line 3600) | astNode(o) {
class Obj (line 3616) | class Obj extends Base {
method constructor (line 3617) | constructor(props, generated = false) {
method isAssignable (line 3623) | isAssignable(opts) {
method shouldCache (line 3643) | shouldCache() {
method hasSplat (line 3648) | hasSplat() {
method reorderProperties (line 3663) | reorderProperties() {
method compileNode (line 3671) | compileNode(o) {
method getAndCheckSplatProps (line 3752) | getAndCheckSplatProps() {
method assigns (line 3775) | assigns(name) {
method eachName (line 3787) | eachName(iterator) {
method expandProperty (line 3807) | expandProperty(property) {
method expandProperties (line 3838) | expandProperties() {
method propagateLhs (line 3849) | propagateLhs(setLhs) {
method astNode (line 3883) | astNode(o) {
method astType (line 3888) | astType() {
method astProperties (line 3896) | astProperties(o) {
method constructor (line 3922) | constructor({key, fromAssign}) {
method astProperties (line 3948) | astProperties(o) {
class Arr (line 3969) | class Arr extends Base {
method constructor (line 3970) | constructor(objs, lhs1 = false) {
method hasElision (line 3977) | hasElision() {
method isAssignable (line 3989) | isAssignable(opts) {
method shouldCache (line 4008) | shouldCache() {
method compileNode (line 4012) | compileNode(o) {
method assigns (line 4097) | assigns(name) {
method eachName (line 4109) | eachName(iterator) {
method propagateLhs (line 4123) | propagateLhs(setLhs) {
method astType (line 4150) | astType() {
method astProperties (line 4158) | astProperties(o) {
class Class (line 4187) | class Class extends Base {
method constructor (line 4188) | constructor(variable1, parent1, body1) {
method compileNode (line 4199) | compileNode(o) {
method compileClassDeclaration (line 4234) | compileClassDeclaration(o) {
method determineName (line 4274) | determineName() {
method walkBody (line 4298) | walkBody(o) {
method addInitializerExpression (line 4386) | addInitializerExpression(node, o) {
method validInitializerMethod (line 4401) | validInitializerMethod(node) {
method addInitializerMethod (line 4412) | addInitializerMethod(assign) {
method validClassProperty (line 4439) | validClassProperty(node) {
method addClassProperty (line 4446) | addClassProperty(assign) {
method validClassPrototypeProperty (line 4459) | validClassPrototypeProperty(node) {
method addClassPrototypeProperty (line 4466) | addClassPrototypeProperty(assign) {
method makeDefaultConstructor (line 4475) | makeDefaultConstructor() {
method proxyBoundMethods (line 4491) | proxyBoundMethods() {
method declareName (line 4510) | declareName(o) {
method isStatementAst (line 4519) | isStatementAst() {
method astNode (line 4523) | astNode(o) {
method astType (line 4545) | astType(o) {
method astProperties (line 4553) | astProperties(o) {
class ExecutableClassBody (line 4571) | class ExecutableClassBody extends Base {
method constructor (line 4572) | constructor(_class, body1 = new Block()) {
method compileNode (line 4578) | compileNode(o) {
method walkBody (line 4623) | walkBody() {
method setContext (line 4661) | setContext() {
method addProperties (line 4672) | addProperties(assigns) {
class ClassProperty (line 4715) | class ClassProperty extends Base {
method constructor (line 4716) | constructor({
method astProperties (line 4731) | astProperties(o) {
class ClassPrototypeProperty (line 4754) | class ClassPrototypeProperty extends Base {
method constructor (line 4755) | constructor({
method astProperties (line 4764) | astProperties(o) {
class ModuleDeclaration (line 4784) | class ModuleDeclaration extends Base {
method constructor (line 4785) | constructor(clause, source1, assertions) {
method checkSource (line 4793) | checkSource() {
method checkScope (line 4799) | checkScope(o, moduleDeclarationType) {
method astAssertions (line 4809) | astAssertions(o) {
method compileNode (line 4844) | compileNode(o) {
method astNode (line 4867) | astNode(o) {
method astProperties (line 4872) | astProperties(o) {
class ImportClause (line 4888) | class ImportClause extends Base {
method constructor (line 4889) | constructor(defaultBinding, namedImports) {
method compileNode (line 4895) | compileNode(o) {
method astNode (line 4910) | astNode(o) {
method compileNode (line 4926) | compileNode(o) {
method checkForAnonymousClassExport (line 4956) | checkForAnonymousClassExport() {
method astNode (line 4962) | astNode(o) {
method astProperties (line 4970) | astProperties(o) {
method astProperties (line 4991) | astProperties(o) {
method astProperties (line 5001) | astProperties(o) {
class ModuleSpecifierList (line 5012) | class ModuleSpecifierList extends Base {
method constructor (line 5013) | constructor(specifiers) {
method compileNode (line 5018) | compileNode(o) {
method astNode (line 5048) | astNode(o) {
class ModuleSpecifier (line 5072) | class ModuleSpecifier extends Base {
method constructor (line 5073) | constructor(original, alias, moduleDeclarationType1) {
method compileNode (line 5092) | compileNode(o) {
method addIdentifierToScope (line 5103) | addIdentifierToScope(o) {
method astNode (line 5107) | astNode(o) {
method constructor (line 5121) | constructor(imported, local) {
method addIdentifierToScope (line 5125) | addIdentifierToScope(o) {
method astProperties (line 5137) | astProperties(o) {
method astProperties (line 5150) | astProperties(o) {
method astProperties (line 5159) | astProperties(o) {
method constructor (line 5168) | constructor(local, exported) {
method astProperties (line 5172) | astProperties(o) {
method compileNode (line 5184) | compileNode() {
method astType (line 5188) | astType() {
method compileNode (line 5195) | compileNode(o) {
method checkArguments (line 5200) | checkArguments() {
method astNode (line 5207) | astNode(o) {
class Assign (line 5219) | class Assign extends Base {
method constructor (line 5220) | constructor(variable1, value1, context1, options = {}) {
method isStatement (line 5229) | isStatement(o) {
method checkNameAssignability (line 5233) | checkNameAssignability(o, varBase) {
method assigns (line 5239) | assigns(name) {
method unfoldSoak (line 5243) | unfoldSoak(o) {
method addScopeVariables (line 5250) | addScopeVariables(o, {allowAssignmentToExpansion = false, allowAssignm...
method compileNode (line 5308) | compileNode(o) {
method compileObjectDestruct (line 5368) | compileObjectDestruct(o) {
method compileDestructuring (line 5386) | compileDestructuring(o) {
method disallowLoneExpansion (line 5603) | disallowLoneExpansion() {
method getAndCheckSplatsAndExpansions (line 5620) | getAndCheckSplatsAndExpansions() {
method compileConditional (line 5666) | compileConditional(o) {
method compileSpecialMath (line 5690) | compileSpecialMath(o) {
method compileSplice (line 5698) | compileSplice(o) {
method eachName (line 5738) | eachName(iterator) {
method isDefaultAssignment (line 5742) | isDefaultAssignment() {
method propagateLhs (line 5746) | propagateLhs() {
method throwUnassignableConditionalError (line 5757) | throwUnassignableConditionalError(name) {
method isConditional (line 5761) | isConditional() {
method astNode (line 5766) | astNode(o) {
method astType (line 5785) | astType() {
method astProperties (line 5793) | astProperties(o) {
method constructor (line 5819) | constructor(glyph) {
class Code (line 5832) | class Code extends Base {
method constructor (line 5833) | constructor(params, body, funcGlyph, paramStart) {
method isStatement (line 5858) | isStatement() {
method makeScope (line 5862) | makeScope(parentScope) {
method compileNode (line 5872) | compileNode(o) {
method updateOptions (line 6158) | updateOptions(o) {
method checkForDuplicateParams (line 6166) | checkForDuplicateParams() {
method eachParamName (line 6177) | eachParamName(iterator) {
method traverseChildren (line 6190) | traverseChildren(crossScope, func) {
method replaceInContext (line 6198) | replaceInContext(child, replacement) {
method disallowSuperInParamDefaults (line 6206) | disallowSuperInParamDefaults({forAst} = {}) {
method checkSuperCallsInConstructorBody (line 6217) | checkSuperCallsInConstructorBody() {
method flagThisParamInDerivedClassConstructorWithoutCallingSuper (line 6230) | flagThisParamInDerivedClassConstructorWithoutCallingSuper(param) {
method checkForAsyncOrGeneratorConstructor (line 6234) | checkForAsyncOrGeneratorConstructor() {
method disallowLoneExpansionAndMultipleSplats (line 6245) | disallowLoneExpansionAndMultipleSplats() {
method expandCtorSuper (line 6268) | expandCtorSuper(thisAssignments) {
method eachSuperCall (line 6286) | eachSuperCall(context, iterator, {checkForThisBeforeSuper = true} = {}) {
method propagateLhs (line 6316) | propagateLhs() {
method astAddParamsToScope (line 6334) | astAddParamsToScope(o) {
method astNode (line 6340) | astNode(o) {
method astType (line 6364) | astType() {
method paramForAst (line 6374) | paramForAst(param) {
method methodAstProperties (line 6396) | methodAstProperties(o) {
method astProperties (line 6421) | astProperties(o) {
method astLocationData (line 6446) | astLocationData() {
class Param (line 6475) | class Param extends Base {
method constructor (line 6476) | constructor(name1, value1, splat1) {
method compileToFragments (line 6492) | compileToFragments(o) {
method compileToFragmentsWithoutComments (line 6496) | compileToFragmentsWithoutComments(o) {
method asReference (line 6500) | asReference(o) {
method shouldCache (line 6520) | shouldCache() {
method eachName (line 6530) | eachName(iterator, name = this.name) {
method renameParam (line 6601) | renameParam(node, newNode) {
class Splat (line 6642) | class Splat extends Base {
method constructor (line 6643) | constructor(name, {
method shouldCache (line 6653) | shouldCache() {
method isAssignable (line 6657) | isAssignable({allowComplexSplat = false} = {}) {
method assigns (line 6664) | assigns(name) {
method compileNode (line 6668) | compileNode(o) {
method unwrap (line 6677) | unwrap() {
method propagateLhs (line 6681) | propagateLhs(setLhs) {
method astType (line 6692) | astType() {
method astProperties (line 6702) | astProperties(o) {
class Expansion (line 6722) | class Expansion extends Base {
method compileNode (line 6723) | compileNode(o) {
method asReference (line 6727) | asReference(o) {
method eachName (line 6731) | eachName(iterator) {}
method throwLhsError (line 6733) | throwLhsError() {
method astNode (line 6737) | astNode(o) {
method astType (line 6744) | astType() {
method astProperties (line 6748) | astProperties() {
class Elision (line 6766) | class Elision extends Base {
method compileToFragments (line 6767) | compileToFragments(o, level) {
method compileNode (line 6774) | compileNode(o) {
method asReference (line 6778) | asReference(o) {
method eachName (line 6782) | eachName(iterator) {}
method astNode (line 6784) | astNode() {
class While (line 6804) | class While extends Base {
method constructor (line 6805) | constructor(condition1, {
method makeReturn (line 6817) | makeReturn(results, mark) {
method addBody (line 6831) | addBody(body1) {
method jumps (line 6836) | jumps() {
method compileNode (line 6856) | compileNode(o) {
method processedCondition (line 6886) | processedCondition() {
method astType (line 6890) | astType() {
method astProperties (line 6894) | astProperties(o) {
class Op (line 6923) | class Op extends Base {
method constructor (line 6924) | constructor(op, first, second, flip, {invertOperator, originalOperator...
method isNumber (line 6954) | isNumber() {
method isAwait (line 6959) | isAwait() {
method isYield (line 6963) | isYield() {
method isUnary (line 6968) | isUnary() {
method shouldCache (line 6972) | shouldCache() {
method isChainable (line 6978) | isChainable() {
method isChain (line 6983) | isChain() {
method invert (line 6987) | invert() {
method unfoldSoak (line 7025) | unfoldSoak(o) {
method generateDo (line 7030) | generateDo(exp) {
method isInOperator (line 7049) | isInOperator() {
method compileNode (line 7053) | compileNode(o) {
method compileChain (line 7106) | compileChain(o) {
method compileExistence (line 7115) | compileExistence(o, checkOnlyUndefined) {
method compileUnary (line 7130) | compileUnary(o) {
method compileContinuation (line 7156) | compileContinuation(o) {
method checkContinuation (line 7183) | checkContinuation(o) {
method compileFloorDivision (line 7193) | compileFloorDivision(o) {
method compileModulo (line 7201) | compileModulo(o) {
method toString (line 7207) | toString(idt) {
method checkDeleteOperand (line 7211) | checkDeleteOperand(o) {
method astNode (line 7217) | astNode(o) {
method astType (line 7225) | astType() {
method operatorAst (line 7252) | operatorAst() {
method chainAstProperties (line 7256) | chainAstProperties(o) {
method astProperties (line 7284) | astProperties(o) {
class In (line 7342) | class In extends Base {
method constructor (line 7343) | constructor(object1, array) {
method compileNode (line 7349) | compileNode(o) {
method compileOrTest (line 7369) | compileOrTest(o) {
method compileLoopTest (line 7389) | compileLoopTest(o) {
method toString (line 7404) | toString(idt) {
class Try (line 7422) | class Try extends Base {
method constructor (line 7423) | constructor(attempt, _catch, ensure, finallyTag) {
method jumps (line 7431) | jumps(o) {
method makeReturn (line 7436) | makeReturn(results, mark) {
method compileNode (line 7458) | compileNode(o) {
method astType (line 7472) | astType() {
method astProperties (line 7476) | astProperties(o) {
class Catch (line 7497) | class Catch extends Base {
method constructor (line 7498) | constructor(recovery, errorVariable) {
method jumps (line 7510) | jumps(o) {
method makeReturn (line 7514) | makeReturn(results, mark) {
method compileNode (line 7524) | compileNode(o) {
method checkUnassignable (line 7538) | checkUnassignable() {
method astNode (line 7548) | astNode(o) {
method astType (line 7561) | astType() {
method astProperties (line 7565) | astProperties(o) {
class Throw (line 7587) | class Throw extends Base {
method constructor (line 7588) | constructor(expression1) {
method compileNode (line 7593) | compileNode(o) {
method astType (line 7602) | astType() {
method astProperties (line 7606) | astProperties(o) {
class Existence (line 7633) | class Existence extends Base {
method constructor (line 7634) | constructor(expression1, onlyNotUndefined = false) {
method compileNode (line 7657) | compileNode(o) {
method astType (line 7677) | astType() {
method astProperties (line 7681) | astProperties(o) {
class Parens (line 7707) | class Parens extends Base {
method constructor (line 7708) | constructor(body1) {
method unwrap (line 7713) | unwrap() {
method shouldCache (line 7717) | shouldCache() {
method compileNode (line 7721) | compileNode(o) {
method astNode (line 7748) | astNode(o) {
class StringWithInterpolations (line 7762) | class StringWithInterpolations extends Base {
method constructor (line 7763) | constructor(body1, {quote, startQuote, jsxAttribute} = {}) {
method fromStringLiteral (line 7771) | static fromStringLiteral(stringLiteral) {
method unwrap (line 7784) | unwrap() {
method shouldCache (line 7788) | shouldCache() {
method extractElements (line 7792) | extractElements(o, {includeInterpolationWrappers, isJsx} = {}) {
method compileNode (line 7856) | compileNode(o) {
method isNestedTag (line 7908) | isNestedTag(element) {
method astType (line 7914) | astType() {
method astProperties (line 7918) | astProperties(o) {
method constructor (line 7954) | constructor(value1, {
method astProperties (line 7962) | astProperties() {
class Interpolation (line 7974) | class Interpolation extends Base {
method constructor (line 7975) | constructor(expression1) {
method constructor (line 7991) | constructor() {
class For (line 8007) | class For extends While {
method constructor (line 8008) | constructor(body, source) {
method isAwait (line 8014) | isAwait() {
method addBody (line 8019) | addBody(body) {
method addSource (line 8031) | addSource(source) {
method compileNode (line 8104) | compileNode(o) {
method astNode (line 8249) | astNode(o) {
method astType (line 8269) | astType() {
method astProperties (line 8273) | astProperties(o) {
class Switch (line 8312) | class Switch extends Base {
method constructor (line 8313) | constructor(subject, cases1, otherwise) {
method jumps (line 8320) | jumps(o = {
method makeReturn (line 8334) | makeReturn(results, mark) {
method compileNode (line 8350) | compileNode(o) {
method astType (line 8385) | astType() {
method casesAst (line 8389) | casesAst(o) {
method astProperties (line 8436) | astProperties(o) {
class SwitchCase (line 8455) | class SwitchCase extends Base {
method constructor (line 8456) | constructor(test1, block1, {trailing} = {}) {
method astProperties (line 8463) | astProperties(o) {
class SwitchWhen (line 8481) | class SwitchWhen extends Base {
method constructor (line 8482) | constructor(conditions1, block1) {
class If (line 8504) | class If extends Base {
method constructor (line 8505) | constructor(condition1, body1, options = {}) {
method bodyNode (line 8517) | bodyNode() {
method elseBodyNode (line 8522) | elseBodyNode() {
method addElse (line 8528) | addElse(elseBody) {
method isStatement (line 8545) | isStatement(o) {
method jumps (line 8550) | jumps(o) {
method compileNode (line 8555) | compileNode(o) {
method makeReturn (line 8563) | makeReturn(results, mark) {
method ensureBlock (line 8582) | ensureBlock(node) {
method compileStatement (line 8592) | compileStatement(o) {
method compileExpression (line 8622) | compileExpression(o) {
method unfoldSoak (line 8635) | unfoldSoak() {
method processedCondition (line 8639) | processedCondition() {
method isStatementAst (line 8643) | isStatementAst(o) {
method astType (line 8647) | astType(o) {
method astProperties (line 8655) | astProperties(o) {
class Sequence (line 8678) | class Sequence extends Base {
method constructor (line 8679) | constructor(expressions1) {
method astNode (line 8684) | astNode(o) {
method astType (line 8691) | astType() {
method astProperties (line 8695) | astProperties(o) {
FILE: lib/coffeescript/optparse.js
method constructor (line 25) | constructor(ruleDeclarations, banner) {
method parse (line 36) | parse(args) {
method help (line 74) | help() {
FILE: lib/coffeescript/parser.js
function popStack (line 1214) | function popStack(n) {
function Parser (line 1328) | function Parser () {
FILE: lib/coffeescript/rewriter.js
class Rewriter (line 57) | class Rewriter {
method rewrite (line 63) | rewrite(tokens1) {
method scanTokens (line 118) | scanTokens(block) {
method detectEnd (line 128) | detectEnd(i, condition, action, opts = {}) {
method removeLeadingNewlines (line 154) | removeLeadingNewlines() {
method closeOpenCalls (line 180) | closeOpenCalls() {
method closeOpenIndexes (line 199) | closeOpenIndexes() {
method indexOfTag (line 226) | indexOfTag(i, ...pattern) {
method looksObjectish (line 245) | looksObjectish(j) {
method findTagsBackwards (line 269) | findTagsBackwards(i, tags) {
method addImplicitBracesAndParens (line 286) | addImplicitBracesAndParens() {
method enforceValidJSXAttributes (line 609) | enforceValidJSXAttributes() {
method rescueStowawayComments (line 625) | rescueStowawayComments() {
method addLocationDataToGeneratedTokens (line 748) | addLocationDataToGeneratedTokens() {
method fixIndentationLocationData (line 794) | fixIndentationLocationData() {
method normalizeLines (line 897) | normalizeLines() {
method tagPostfixConditionals (line 1001) | tagPostfixConditionals() {
method exposeTokenDataToGrammar (line 1030) | exposeTokenDataToGrammar() {
method indentation (line 1050) | indentation(origin) {
method tag (line 1064) | tag(i) {
FILE: lib/coffeescript/scope.js
method constructor (line 19) | constructor(parent, expressions, method, referencedVars) {
method add (line 41) | add(name, type, immediate) {
method namedMethod (line 57) | namedMethod() {
method find (line 67) | find(name, type = 'var') {
method parameter (line 77) | parameter(name) {
method check (line 86) | check(name) {
method temporary (line 92) | temporary(name, index, single = false) {
method type (line 108) | type(name) {
method freeVariable (line 122) | freeVariable(name, options = {}) {
method assign (line 140) | assign(name, value) {
method hasDeclarations (line 149) | hasDeclarations() {
method declaredVariables (line 154) | declaredVariables() {
method assignedVariables (line 172) | assignedVariables() {
FILE: lib/coffeescript/sourcemap.js
method constructor (line 23) | constructor(line1) {
method add (line 28) | add(column, [sourceLine, sourceColumn], options = {}) {
method sourceLocation (line 40) | sourceLocation(column) {
class SourceMap (line 62) | class SourceMap {
method constructor (line 63) | constructor() {
method add (line 71) | add(sourceLocation, generatedLocation, options = {}) {
method sourceLocation (line 80) | sourceLocation([line, column]) {
method registerCompiled (line 88) | static registerCompiled(filename, source, sourcemap) {
method getSourceMap (line 94) | static getSourceMap(filename) {
method generate (line 105) | generate(options = {}, code = null) {
method encodeVlq (line 169) | encodeVlq(value) {
method encodeBase64 (line 188) | encodeBase64(value) {
Condensed preview — 421 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,758K chars).
[
{
"path": ".babelrc",
"chars": 32,
"preview": "{\n \"presets\": [\"@babel/env\"]\n}\n"
},
{
"path": ".github/workflows/continuous-integration.yml",
"chars": 1475,
"preview": "# Based on https://github.com/actions/starter-workflows/blob/master/ci/node.js.yml\n\nname: Build and Test\n\non: [push, pul"
},
{
"path": ".gitignore",
"chars": 146,
"preview": "raw\npresentation\ntest.coffee\ntest*.coffee\ntest.litcoffee\ntest*.litcoffee\ntest/*.js\nparser.output\n/node_modules\nnpm-debug"
},
{
"path": ".nojekyll",
"chars": 0,
"preview": ""
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3225,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 1268,
"preview": "## How to contribute to CoffeeScript\n\n* Before you open a ticket or send a pull request, [search](https://github.com/jas"
},
{
"path": "Cakefile",
"chars": 21464,
"preview": "fs = require 'fs'\nos = require 'os'\npath = require 'p"
},
{
"path": "ISSUE_TEMPLATE.md",
"chars": 2804,
"preview": "<!---\nThanks for filing an issue 😄! Before you submit, please read the following:\n\nSearch open/closed issues before subm"
},
{
"path": "LICENSE",
"chars": 1064,
"preview": "Copyright (c) 2009-2018 Jeremy Ashkenas\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of"
},
{
"path": "PULL_REQUEST_TEMPLATE.md",
"chars": 1207,
"preview": "<!--\nBefore making a PR please make sure to read our contributing guidelines:\nhttps://coffeescript.org/#contributing\n\nFo"
},
{
"path": "README.md",
"chars": 2774,
"preview": "```\n @@@@@@@ @@@@ @@@@@\n @@@@@@@@@@ @@@ @@@ "
},
{
"path": "bin/cake",
"chars": 755,
"preview": "#!/usr/bin/env node\n\ntry {\n new Function('var {a} = {a: 1}')();\n} catch (error) {\n console.error('Your JavaScript runt"
},
{
"path": "bin/coffee",
"chars": 760,
"preview": "#!/usr/bin/env node\n\ntry {\n new Function('var {a} = {a: 1}')();\n} catch (error) {\n console.error('Your JavaScript runt"
},
{
"path": "bower.json",
"chars": 288,
"preview": "{\n \"name\": \"coffeescript\",\n \"main\": [\n \"lib/coffeescript/browser.js\"\n ],\n \"description\": \"Unfancy JavaScript\",\n "
},
{
"path": "docs/CNAME",
"chars": 16,
"preview": "coffeescript.org"
},
{
"path": "docs/browserconfig.xml",
"chars": 231,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<browserconfig>\r\n <msapplication>\r\n <tile>\r\n <square150x150logo src=\"/m"
},
{
"path": "docs/manifest.json",
"chars": 330,
"preview": "{\n\t\"name\": \"CoffeeScript\",\n\t\"description\": \"Unfancy JavaScript\",\n\t\"icons\": [\n\t\t{\n\t\t\t\"src\": \"\\/android-chrome-192x192.png"
},
{
"path": "docs/v1/annotated-source/browser.html",
"chars": 12291,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>browser.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v1/annotated-source/cake.html",
"chars": 14278,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>cake.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charse"
},
{
"path": "docs/v1/annotated-source/coffee-script.html",
"chars": 45287,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>coffee-script.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/htm"
},
{
"path": "docs/v1/annotated-source/command.html",
"chars": 47298,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>command.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v1/annotated-source/docco.css",
"chars": 9921,
"preview": "/*--------------------- Typography ----------------------------*/\n\n@font-face {\n font-family: 'aller-light';\n src:"
},
{
"path": "docs/v1/annotated-source/grammar.html",
"chars": 106871,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>grammar.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v1/annotated-source/helpers.html",
"chars": 26394,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>helpers.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v1/annotated-source/index.html",
"chars": 3727,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>index.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v1/annotated-source/lexer.html",
"chars": 125215,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>lexer.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v1/annotated-source/nodes.html",
"chars": 293531,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>nodes.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v1/annotated-source/optparse.html",
"chars": 15233,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>optparse.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v1/annotated-source/public/stylesheets/normalize.css",
"chars": 6874,
"preview": "/*! normalize.css v2.0.1 | MIT License | git.io/normalize */\n\n/* ======================================================="
},
{
"path": "docs/v1/annotated-source/register.html",
"chars": 9207,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>register.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v1/annotated-source/repl.html",
"chars": 25735,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>repl.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charse"
},
{
"path": "docs/v1/annotated-source/rewriter.html",
"chars": 69582,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>rewriter.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v1/annotated-source/scope.html",
"chars": 16217,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>scope.litcoffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v1/annotated-source/sourcemap.html",
"chars": 20216,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>sourcemap.litcoffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html"
},
{
"path": "docs/v1/browser-compiler/coffee-script.js",
"chars": 202373,
"preview": "/**\n * CoffeeScript Compiler v1.12.7\n * http://coffeescript.org\n *\n * Copyright 2011, Jeremy Ashkenas\n * Released under "
},
{
"path": "docs/v1/index.html",
"chars": 224773,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n<title>CoffeeScript</"
},
{
"path": "docs/v1/test.html",
"chars": 258743,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n <title>CoffeeScri"
},
{
"path": "docs/v2/annotated-source/browser.html",
"chars": 14903,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>browser.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v2/annotated-source/cake.html",
"chars": 14305,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>cake.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charse"
},
{
"path": "docs/v2/annotated-source/coffeescript.html",
"chars": 40340,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>coffeescript.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html"
},
{
"path": "docs/v2/annotated-source/command.html",
"chars": 58033,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>command.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v2/annotated-source/docco.css",
"chars": 9889,
"preview": "/*--------------------- Typography ----------------------------*/\n\n@font-face {\n font-family: 'aller-light';\n src:"
},
{
"path": "docs/v2/annotated-source/grammar.html",
"chars": 161673,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>grammar.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v2/annotated-source/helpers.html",
"chars": 42491,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>helpers.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; cha"
},
{
"path": "docs/v2/annotated-source/index.html",
"chars": 20954,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>index.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v2/annotated-source/lexer.html",
"chars": 174348,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>lexer.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v2/annotated-source/nodes.html",
"chars": 599058,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>nodes.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; chars"
},
{
"path": "docs/v2/annotated-source/optparse.html",
"chars": 20236,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>optparse.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v2/annotated-source/public/stylesheets/normalize.css",
"chars": 6874,
"preview": "/*! normalize.css v2.0.1 | MIT License | git.io/normalize */\n\n/* ======================================================="
},
{
"path": "docs/v2/annotated-source/register.html",
"chars": 11802,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>register.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v2/annotated-source/repl.html",
"chars": 33905,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>repl.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charse"
},
{
"path": "docs/v2/annotated-source/rewriter.html",
"chars": 118654,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>rewriter.coffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v2/annotated-source/scope.html",
"chars": 16407,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>scope.litcoffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html; ch"
},
{
"path": "docs/v2/annotated-source/sourcemap.html",
"chars": 21939,
"preview": "<!DOCTYPE html>\n\n<html>\n<head>\n <title>sourcemap.litcoffee</title>\n <meta http-equiv=\"content-type\" content=\"text/html"
},
{
"path": "docs/v2/announcing-coffeescript-2/index.html",
"chars": 22953,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n<title>Announcing Cof"
},
{
"path": "docs/v2/browser-compiler-legacy/coffeescript.js",
"chars": 529745,
"preview": "/**\n * CoffeeScript Compiler v2.7.0\n * https://coffeescript.org\n *\n * Copyright 2011-2023, Jeremy Ashkenas\n * Released u"
},
{
"path": "docs/v2/browser-compiler-modern/coffeescript.js",
"chars": 528514,
"preview": "/**\n * CoffeeScript Compiler v2.7.0\n * https://coffeescript.org\n *\n * Copyright 2011-2023, Jeremy Ashkenas\n * Released u"
},
{
"path": "docs/v2/index.html",
"chars": 475370,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n<title>CoffeeScript</"
},
{
"path": "docs/v2/test.html",
"chars": 690736,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n <title>CoffeeScri"
},
{
"path": "documentation/examples/aliases.coffee",
"chars": 223,
"preview": "launch() if ignition is on\n\nvolume = 10 if band isnt SpinalTap\n\nletTheWildRumpusBegin() unless answer is no\n\nif car.spee"
},
{
"path": "documentation/examples/array_comprehensions.coffee",
"chars": 395,
"preview": "# Eat lunch.\neat = (food) -> \"#{food} eaten.\"\neat food for food in ['toast', 'cheese', 'wine']\n\n# Fine five course dinin"
},
{
"path": "documentation/examples/array_spread.coffee",
"chars": 127,
"preview": "popular = ['pepperoni', 'sausage', 'cheese']\nunwanted = ['anchovies', 'olives']\n\nall = [popular..., unwanted..., 'mushr"
},
{
"path": "documentation/examples/async.coffee",
"chars": 408,
"preview": "# Your browser must support async/await and speech synthesis\n# to run this example.\n\nsleep = (ms) ->\n new Promise (reso"
},
{
"path": "documentation/examples/breaking_change_bound_generator_function.coffee",
"chars": 30,
"preview": "self = this\nf = -> yield self\n"
},
{
"path": "documentation/examples/breaking_change_destructuring_default_values.coffee",
"chars": 79,
"preview": "{a = 1} = {a: null}\n\na # Equals 1 in CoffeeScript 1.x, null in CoffeeScript 2\n"
},
{
"path": "documentation/examples/breaking_change_fat_arrow.coffee",
"chars": 128,
"preview": "outer = ->\n inner = => Array.from arguments\n inner()\n\nouter(1, 2) # Returns '' in CoffeeScript 1.x, '1, 2' in CoffeeS"
},
{
"path": "documentation/examples/breaking_change_function_parameter_default_values.coffee",
"chars": 83,
"preview": "f = (a = 1) -> a\n\nf(null) # Returns 1 in CoffeeScript 1.x, null in CoffeeScript 2\n"
},
{
"path": "documentation/examples/breaking_change_super_in_non-class_methods_refactor_with_apply.coffee",
"chars": 358,
"preview": "# Helper functions\nhasProp = {}.hasOwnProperty\nextend = (child, parent) ->\n ctor = ->\n @constructor = child\n retu"
},
{
"path": "documentation/examples/breaking_change_super_in_non-class_methods_refactor_with_class.coffee",
"chars": 55,
"preview": "class A\nclass B extends A\n foo: -> super arguments...\n"
},
{
"path": "documentation/examples/breaking_change_super_this.coffee",
"chars": 71,
"preview": "class B extends A\n constructor: (arg) ->\n super arg\n @arg = arg\n"
},
{
"path": "documentation/examples/breaking_change_super_with_arguments.coffee",
"chars": 47,
"preview": "class B extends A\n foo: -> super arguments...\n"
},
{
"path": "documentation/examples/breaking_change_super_without_arguments.coffee",
"chars": 36,
"preview": "class B extends A\n foo: -> super()\n"
},
{
"path": "documentation/examples/cake_tasks.coffee",
"chars": 286,
"preview": "fs = require 'fs'\n\noption '-o', '--output [DIR]', 'directory for compiled code'\n\ntask 'build:parser', 'rebuild the Jison"
},
{
"path": "documentation/examples/chaining.coffee",
"chars": 97,
"preview": "$ 'body'\n.click (e) ->\n $ '.box'\n .fadeIn 'fast'\n .addClass 'show'\n.css 'background', 'white'\n"
},
{
"path": "documentation/examples/classes.coffee",
"chars": 349,
"preview": "class Animal\n constructor: (@name) ->\n\n move: (meters) ->\n alert @name + \" moved #{meters}m.\"\n\nclass Snake extends "
},
{
"path": "documentation/examples/comment.coffee",
"chars": 125,
"preview": "###\nFortune Cookie Reader v1.0\nReleased under the MIT License\n###\n\nsayFortune = (fortune) ->\n console.log fortune # in "
},
{
"path": "documentation/examples/comparisons.coffee",
"chars": 52,
"preview": "cholesterol = 127\n\nhealthy = 200 > cholesterol > 60\n"
},
{
"path": "documentation/examples/conditionals.coffee",
"chars": 138,
"preview": "mood = greatlyImproved if singing\n\nif happy and knowsIt\n clapsHands()\n chaChaCha()\nelse\n showIt()\n\ndate = if friday t"
},
{
"path": "documentation/examples/constructor_destructuring.coffee",
"chars": 128,
"preview": "class Person\n constructor: (options) ->\n {@name, @age, @height = 'average'} = options\n\ntim = new Person name: 'Tim',"
},
{
"path": "documentation/examples/default_args.coffee",
"chars": 88,
"preview": "fill = (container, liquid = \"coffee\") ->\n \"Filling the #{container} with #{liquid}...\"\n"
},
{
"path": "documentation/examples/do.coffee",
"chars": 198,
"preview": "for filename in list\n do (filename) ->\n if filename not in ['.DS_Store', 'Thumbs.db', 'ehthumbs.db']\n fs.readFi"
},
{
"path": "documentation/examples/dynamic_import.coffee",
"chars": 284,
"preview": "# Your browser must support dynamic import to run this example.\n\ndo ->\n { run } = await import('./browser-compiler-mode"
},
{
"path": "documentation/examples/embedded.coffee",
"chars": 80,
"preview": "hi = `function() {\n return [document.title, \"Hello JavaScript\"].join(\": \");\n}`\n"
},
{
"path": "documentation/examples/embedded_block.coffee",
"chars": 87,
"preview": "```\nfunction time() {\n return `The time is ${new Date().toLocaleTimeString()}`;\n}\n```\n"
},
{
"path": "documentation/examples/embedded_escaped.coffee",
"chars": 85,
"preview": "markdown = `function () {\n return \\`In Markdown, write code like \\\\\\`this\\\\\\`\\`;\n}`\n"
},
{
"path": "documentation/examples/existence.coffee",
"chars": 92,
"preview": "solipsism = true if mind? and not world?\n\nspeed = 0\nspeed ?= 15\n\nfootprints = yeti ? \"bear\"\n"
},
{
"path": "documentation/examples/existence_declared.coffee",
"chars": 83,
"preview": "major = 'Computer Science'\n\nunless major?\n signUpForClass 'Introduction to Wines'\n"
},
{
"path": "documentation/examples/existence_undeclared.coffee",
"chars": 48,
"preview": "if window?\n environment = 'browser (probably)'\n"
},
{
"path": "documentation/examples/expansion.coffee",
"chars": 131,
"preview": "text = \"Every literary critic believes he will\n outwit history and have the last word\"\n\n[first, ..., last] = text"
},
{
"path": "documentation/examples/expressions.coffee",
"chars": 187,
"preview": "grade = (student) ->\n if student.excellentWork\n \"A+\"\n else if student.okayStuff\n if student.triedHard then \"B\" e"
},
{
"path": "documentation/examples/expressions_assignment.coffee",
"chars": 42,
"preview": "six = (one = 1) + (two = 2) + (three = 3)\n"
},
{
"path": "documentation/examples/expressions_comprehension.coffee",
"chars": 80,
"preview": "# The first ten global properties.\n\nglobals = (name for name of window)[0...10]\n"
},
{
"path": "documentation/examples/expressions_try.coffee",
"chars": 93,
"preview": "alert(\n try\n nonexistent / undefined\n catch error\n \"And the error is ... #{error}\"\n)\n"
},
{
"path": "documentation/examples/fat_arrow.coffee",
"chars": 143,
"preview": "Account = (customer, cart) ->\n @customer = customer\n @cart = cart\n\n $('.shopping_cart').on 'click', (event) =>\n @c"
},
{
"path": "documentation/examples/functions.coffee",
"chars": 52,
"preview": "square = (x) -> x * x\ncube = (x) -> square(x) * x\n"
},
{
"path": "documentation/examples/generator_iteration.coffee",
"chars": 279,
"preview": "fibonacci = ->\n [previous, current] = [1, 1]\n loop\n [previous, current] = [current, previous + current]\n yield c"
},
{
"path": "documentation/examples/generators.coffee",
"chars": 111,
"preview": "perfectSquares = ->\n num = 0\n loop\n num += 1\n yield num * num\n return\n\nwindow.ps or= perfectSquares()\n"
},
{
"path": "documentation/examples/get_set.coffee",
"chars": 166,
"preview": "screen =\n width: 1200\n ratio: 16/9\n\nObject.defineProperty screen, 'height',\n get: ->\n this.width / this.ratio\n se"
},
{
"path": "documentation/examples/heredocs.coffee",
"chars": 84,
"preview": "html = \"\"\"\n <strong>\n cup of coffeescript\n </strong>\n \"\"\"\n"
},
{
"path": "documentation/examples/heregexes.coffee",
"chars": 175,
"preview": "NUMBER = ///\n ^ 0b[01]+ | # binary\n ^ 0o[0-7]+ | # octal\n ^ 0x[\\da-f]+ | "
},
{
"path": "documentation/examples/interpolation.coffee",
"chars": 128,
"preview": "author = \"Wittgenstein\"\nquote = \"A picture is a fact. -- #{ author }\"\n\nsentence = \"#{ 22 / 7 } is a decent approximatio"
},
{
"path": "documentation/examples/jsx.coffee",
"chars": 386,
"preview": "renderStarRating = ({ rating, maxStars }) ->\n <aside title={\"Rating: #{rating} of #{maxStars} stars\"}>\n {for wholeSt"
},
{
"path": "documentation/examples/modules.coffee",
"chars": 741,
"preview": "import './local-file.js' # Must be the filename of the generated file\nimport 'package'\n\nimport _ from 'underscore'\nimpor"
},
{
"path": "documentation/examples/modulo.coffee",
"chars": 153,
"preview": "-7 % 5 == -2 # The remainder of 7 / 5\n-7 %% 5 == 3 # n %% 5 is always between 0 and 4\n\ntabs.selectTabAtIndex((tabs.curre"
},
{
"path": "documentation/examples/multiple_return_values.coffee",
"chars": 167,
"preview": "weatherReport = (location) ->\n # Make an Ajax request to fetch the weather...\n [location, 72, \"Mostly Sunny\"]\n\n[city, "
},
{
"path": "documentation/examples/object_comprehensions.coffee",
"chars": 94,
"preview": "yearsOld = max: 10, ida: 9, tim: 11\n\nages = for child, age of yearsOld\n \"#{child} is #{age}\"\n"
},
{
"path": "documentation/examples/object_extraction.coffee",
"chars": 260,
"preview": "futurists =\n sculptor: \"Umberto Boccioni\"\n painter: \"Vladimir Burliuk\"\n poet:\n name: \"F.T. Marinetti\"\n addre"
},
{
"path": "documentation/examples/object_spread.coffee",
"chars": 121,
"preview": "user =\n name: 'Werner Heisenberg'\n occupation: 'theoretical physicist'\n\ncurrentUser = { user..., status: 'Uncertain' }"
},
{
"path": "documentation/examples/objects_and_arrays.coffee",
"chars": 212,
"preview": "song = [\"do\", \"re\", \"mi\", \"fa\", \"so\"]\n\nsingers = {Jagger: \"Rock\", Elvis: \"Roll\"}\n\nbitlist = [\n 1, 0, 1\n 0, 0, 1\n 1, 1"
},
{
"path": "documentation/examples/objects_reserved.coffee",
"chars": 53,
"preview": "$('.account').prop class: 'active'\n\nlog object.class\n"
},
{
"path": "documentation/examples/objects_shorthand.coffee",
"chars": 180,
"preview": "name = \"Michelangelo\"\nmask = \"orange\"\nweapon = \"nunchuks\"\nturtle = {name, mask, weapon}\noutput = \"#{turtle.name} wears a"
},
{
"path": "documentation/examples/overview.coffee",
"chars": 414,
"preview": "# Assignment:\nnumber = 42\nopposite = true\n\n# Conditions:\nnumber = -42 if opposite\n\n# Functions:\nsquare = (x) -> x * x\n"
},
{
"path": "documentation/examples/parallel_assignment.coffee",
"chars": 76,
"preview": "theBait = 1000\ntheSwitch = 0\n\n[theBait, theSwitch] = [theSwitch, theBait]\n"
},
{
"path": "documentation/examples/patterns_and_splats.coffee",
"chars": 65,
"preview": "tag = \"<impossible>\"\n\n[open, contents..., close] = tag.split(\"\")\n"
},
{
"path": "documentation/examples/prototypes.coffee",
"chars": 48,
"preview": "String::dasherize = ->\n this.replace /_/g, \"-\"\n"
},
{
"path": "documentation/examples/range_comprehensions.coffee",
"chars": 37,
"preview": "countdown = (num for num in [10..1])\n"
},
{
"path": "documentation/examples/scope.coffee",
"chars": 79,
"preview": "outer = 1\nchangeNumbers = ->\n inner = -1\n outer = 10\ninner = changeNumbers()\n"
},
{
"path": "documentation/examples/slices.coffee",
"chars": 138,
"preview": "numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\nstart = numbers[0..2]\n\nmiddle = numbers[3...-2]\n\nend = numbers[-2..]\n\ncopy"
},
{
"path": "documentation/examples/soaks.coffee",
"chars": 45,
"preview": "zip = lottery.drawWinner?().address?.zipcode\n"
},
{
"path": "documentation/examples/splats.coffee",
"chars": 414,
"preview": "gold = silver = rest = \"unknown\"\n\nawardMedals = (first, second, others...) ->\n gold = first\n silver = second\n rest "
},
{
"path": "documentation/examples/splices.coffee",
"chars": 75,
"preview": "numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\nnumbers[3..6] = [-3, -4, -5, -6]\n"
},
{
"path": "documentation/examples/static.coffee",
"chars": 318,
"preview": "class Teenager\n @say: (speech) ->\n words = speech.split ' '\n fillers = ['uh', 'um', 'like', 'actually', 'so', 'ma"
},
{
"path": "documentation/examples/strings.coffee",
"chars": 256,
"preview": "mobyDick = \"Call me Ishmael. Some years ago --\n never mind how long precisely -- having little\n or no money in my purs"
},
{
"path": "documentation/examples/switch.coffee",
"chars": 214,
"preview": "switch day\n when \"Mon\" then go work\n when \"Tue\" then go relax\n when \"Thu\" then go iceFishing\n when \"Fri\", \"Sat\"\n "
},
{
"path": "documentation/examples/switch_with_no_expression.coffee",
"chars": 160,
"preview": "score = 76\ngrade = switch\n when score < 60 then 'F'\n when score < 70 then 'D'\n when score < 80 then 'C'\n when score "
},
{
"path": "documentation/examples/tagged_template_literals.coffee",
"chars": 262,
"preview": "upperCaseExpr = (textParts, expressions...) ->\n textParts.reduce (text, textPart, i) ->\n text + expressions[i - 1].t"
},
{
"path": "documentation/examples/try.coffee",
"chars": 103,
"preview": "try\n allHellBreaksLoose()\n catsAndDogsLivingTogether()\ncatch error\n print error\nfinally\n cleanUp()\n"
},
{
"path": "documentation/examples/type_annotations.coffee",
"chars": 131,
"preview": "# @flow\n\n###::\ntype Obj = {\n num: number,\n};\n###\n\nfn = (str ###: string ###, obj ###: Obj ###) ###: string ### ->\n str"
},
{
"path": "documentation/examples/while.coffee",
"chars": 233,
"preview": "# Econ 101\nif this.studyingEconomics\n buy() while supply > demand\n sell() until supply > demand\n\n# Nursery Rhyme\nnum "
},
{
"path": "documentation/sections/annotated_source.md",
"chars": 995,
"preview": "## Annotated Source\n\nYou can browse the CoffeeScript <%= fullVersion %> source in readable, annotated form [here](annota"
},
{
"path": "documentation/sections/announcing_coffeescript_2.md",
"chars": 8471,
"preview": "# Announcing CoffeeScript 2\n\nWe are pleased to announce CoffeeScript 2! This new release of the CoffeeScript language an"
},
{
"path": "documentation/sections/async_functions.md",
"chars": 456,
"preview": "## Async Functions\n\nES2017’s [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Stateme"
},
{
"path": "documentation/sections/books.md",
"chars": 2638,
"preview": "## Books\n\nThere are a number of excellent resources to help you get started with CoffeeScript, some of which are freely "
},
{
"path": "documentation/sections/breaking_changes.md",
"chars": 243,
"preview": "## Breaking Changes From CoffeeScript 1.x to 2\n\nCoffeeScript 2 aims to output as much idiomatic ES2015+ syntax as possib"
},
{
"path": "documentation/sections/breaking_changes_argument_parsing_and_shebang_lines.md",
"chars": 1491,
"preview": "### Argument parsing and shebang (`#!`) lines\n\nIn CoffeeScript 1.x, `--` was required after the path and filename of the"
},
{
"path": "documentation/sections/breaking_changes_bound_generator_functions.md",
"chars": 492,
"preview": "### Bound generator functions\n\nBound generator functions, a.k.a. generator arrow functions, [aren’t allowed in ECMAScrip"
},
{
"path": "documentation/sections/breaking_changes_classes.md",
"chars": 1208,
"preview": "### Classes are compiled to ES2015 classes\n\nES2015 classes and their methods have some restrictions beyond those on regu"
},
{
"path": "documentation/sections/breaking_changes_default_values.md",
"chars": 708,
"preview": "### Default values for function parameters and destructured elements\n\nPer the [ES2015 spec regarding function default pa"
},
{
"path": "documentation/sections/breaking_changes_fat_arrow.md",
"chars": 595,
"preview": "### Bound (fat arrow) functions\n\nIn CoffeeScript 1.x, `=>` compiled to a regular `function` but with references to `this"
},
{
"path": "documentation/sections/breaking_changes_jsx_and_the_less_than_and_greater_than_operators.md",
"chars": 517,
"preview": "### JSX and the `<` and `>` operators\n\nWith the addition of [JSX](#jsx), the `<` and `>` characters serve as both the “l"
},
{
"path": "documentation/sections/breaking_changes_literate_coffeescript.md",
"chars": 751,
"preview": "### Literate CoffeeScript parsing\n\nCoffeeScript 2’s parsing of Literate CoffeeScript has been refactored to now be more "
},
{
"path": "documentation/sections/breaking_changes_super_extends.md",
"chars": 1172,
"preview": "### `super` and `extends`\n\nDue to a syntax clash with `super` with accessors, “bare” `super` (the keyword `super` withou"
},
{
"path": "documentation/sections/breaking_changes_super_this.md",
"chars": 595,
"preview": "### `super` and `this`\n\nIn the constructor of a derived class (a class that `extends` another class), `this` cannot be u"
},
{
"path": "documentation/sections/cake.md",
"chars": 1339,
"preview": "## Cake, and Cakefiles\n\nCoffeeScript includes a (very) simple build system similar to [Make](http://www.gnu.org/software"
},
{
"path": "documentation/sections/chaining.md",
"chars": 130,
"preview": "## Chaining Function Calls\n\nLeading `.` closes all open calls, allowing for simpler chaining syntax.\n\n```\ncodeFor('chain"
},
{
"path": "documentation/sections/changelog/0.1.0.md",
"chars": 120,
"preview": "```\nreleaseHeader('2009-12-24', '0.1.0', '8e9d637985d2dc9b44922076ad54ffef7fa8e9c2')\n```\n\nInitial CoffeeScript release.\n"
},
{
"path": "documentation/sections/changelog/0.1.1.md",
"chars": 101,
"preview": "```\nreleaseHeader('2009-12-24', '0.1.1', '0.1.0')\n```\n\nAdded `instanceof` and `typeof` as operators.\n"
},
{
"path": "documentation/sections/changelog/0.1.2.md",
"chars": 447,
"preview": "```\nreleaseHeader('2009-12-24', '0.1.2', '0.1.1')\n```\n\nFixed a bug with calling `super()` through more than one level of"
},
{
"path": "documentation/sections/changelog/0.1.3.md",
"chars": 527,
"preview": "```\nreleaseHeader('2009-12-25', '0.1.3', '0.1.2')\n```\n\nThe `coffee` command now includes `--interactive`, which launches"
},
{
"path": "documentation/sections/changelog/0.1.4.md",
"chars": 530,
"preview": "```\nreleaseHeader('2009-12-25', '0.1.4', '0.1.3')\n```\n\nThe official CoffeeScript extension is now `.coffee` instead of `"
},
{
"path": "documentation/sections/changelog/0.1.5.md",
"chars": 379,
"preview": "```\nreleaseHeader('2009-12-26', '0.1.5', '0.1.4')\n```\n\nArray slice literals and array comprehensions can now both take R"
},
{
"path": "documentation/sections/changelog/0.1.6.md",
"chars": 195,
"preview": "```\nreleaseHeader('2009-12-27', '0.1.6', '0.1.5')\n```\n\nBugfix for running `coffee --interactive` and `--run` from outsid"
},
{
"path": "documentation/sections/changelog/0.2.0.md",
"chars": 375,
"preview": "```\nreleaseHeader('2010-01-05', '0.2.0', '0.1.6')\n```\n\nMajor release. Significant whitespace. Better statement-to-expres"
},
{
"path": "documentation/sections/changelog/0.2.1.md",
"chars": 125,
"preview": "```\nreleaseHeader('2010-01-05', '0.2.1', '0.2.0')\n```\n\nArguments objects are now converted into real arrays when referen"
},
{
"path": "documentation/sections/changelog/0.2.2.md",
"chars": 669,
"preview": "```\nreleaseHeader('2010-01-10', '0.2.2', '0.2.1')\n```\n\nWhen performing a comprehension over an object, use `ino`, instea"
},
{
"path": "documentation/sections/changelog/0.2.3.md",
"chars": 193,
"preview": "```\nreleaseHeader('2010-01-11', '0.2.3', '0.2.2')\n```\n\nAxed the unsatisfactory `ino` keyword, replacing it with `of` for"
},
{
"path": "documentation/sections/changelog/0.2.4.md",
"chars": 264,
"preview": "```\nreleaseHeader('2010-01-12', '0.2.4', '0.2.3')\n```\n\nAdded ECMAScript Harmony style destructuring assignment, for deal"
},
{
"path": "documentation/sections/changelog/0.2.5.md",
"chars": 420,
"preview": "```\nreleaseHeader('2010-01-13', '0.2.5', '0.2.4')\n```\n\nThe conditions in switch statements can now take multiple values "
},
{
"path": "documentation/sections/changelog/0.2.6.md",
"chars": 302,
"preview": "```\nreleaseHeader('2010-01-17', '0.2.6', '0.2.5')\n```\n\nAdded Python-style chained comparisons, the conditional existence"
},
{
"path": "documentation/sections/changelog/0.3.0.md",
"chars": 421,
"preview": "```\nreleaseHeader('2010-01-26', '0.3.0', '0.2.6')\n```\n\nCoffeeScript 0.3 includes major syntax changes:\nThe function symb"
},
{
"path": "documentation/sections/changelog/0.3.2.md",
"chars": 233,
"preview": "```\nreleaseHeader('2010-02-08', '0.3.2', '0.3.0')\n```\n\n`@property` is now a shorthand for `this.property`.\nSwitched the "
},
{
"path": "documentation/sections/changelog/0.5.0.md",
"chars": 232,
"preview": "```\nreleaseHeader('2010-02-21', '0.5.0', '0.3.2')\n```\n\nCoffeeScript 0.5.0 is a major release, While there are no languag"
},
{
"path": "documentation/sections/changelog/0.5.1.md",
"chars": 271,
"preview": "```\nreleaseHeader('2010-02-24', '0.5.1', '0.5.0')\n```\n\nImprovements to null soaking with the existential operator, inclu"
},
{
"path": "documentation/sections/changelog/0.5.2.md",
"chars": 345,
"preview": "```\nreleaseHeader('2010-02-25', '0.5.2', '0.5.1')\n```\n\nAdded a compressed version of the compiler for inclusion in web p"
},
{
"path": "documentation/sections/changelog/0.5.3.md",
"chars": 424,
"preview": "```\nreleaseHeader('2010-02-27', '0.5.3', '0.5.2')\n```\n\nCoffeeScript now has a syntax for defining classes. Many of the c"
},
{
"path": "documentation/sections/changelog/0.5.4.md",
"chars": 266,
"preview": "```\nreleaseHeader('2010-03-03', '0.5.4', '0.5.3')\n```\n\nBugfix that corrects the Node.js global constants `__filename` an"
},
{
"path": "documentation/sections/changelog/0.5.5.md",
"chars": 305,
"preview": "```\nreleaseHeader('2010-03-08', '0.5.5', '0.5.4')\n```\n\nString interpolation, contributed by [Stan Angeloff](https://gith"
},
{
"path": "documentation/sections/changelog/0.5.6.md",
"chars": 524,
"preview": "```\nreleaseHeader('2010-03-23', '0.5.6', '0.5.5')\n```\n\nInterpolation can now be used within regular expressions and here"
},
{
"path": "documentation/sections/changelog/0.6.0.md",
"chars": 198,
"preview": "```\nreleaseHeader('2010-04-03', '0.6.0', '0.5.6')\n```\n\nTrailing commas are now allowed, a-la Python. Static properties m"
},
{
"path": "documentation/sections/changelog/0.6.1.md",
"chars": 136,
"preview": "```\nreleaseHeader('2010-04-12', '0.6.1', '0.6.0')\n```\n\nUpgraded CoffeeScript for compatibility with the new Node.js **v0"
},
{
"path": "documentation/sections/changelog/0.6.2.md",
"chars": 773,
"preview": "```\nreleaseHeader('2010-05-15', '0.6.2', '0.6.1')\n```\n\nThe `coffee` command will now preserve directory structure when c"
},
{
"path": "documentation/sections/changelog/0.7.0.md",
"chars": 954,
"preview": "```\nreleaseHeader('2010-06-28', '0.7.0', '0.6.2')\n```\n\nOfficial CoffeeScript variable style is now camelCase, as in Java"
},
{
"path": "documentation/sections/changelog/0.7.1.md",
"chars": 328,
"preview": "```\nreleaseHeader('2010-07-11', '0.7.1', '0.7.0')\n```\n\nBlock-style comments are now passed through and printed as JavaSc"
},
{
"path": "documentation/sections/changelog/0.7.2.md",
"chars": 188,
"preview": "```\nreleaseHeader('2010-07-12', '0.7.2', '0.7.1')\n```\n\nQuick bugfix (right after 0.7.1) for a problem that prevented `co"
},
{
"path": "documentation/sections/changelog/0.9.0.md",
"chars": 1364,
"preview": "```\nreleaseHeader('2010-08-04', '0.9.0', '0.7.2')\n```\n\nThe CoffeeScript **0.9** series is considered to be a release can"
},
{
"path": "documentation/sections/changelog/0.9.1.md",
"chars": 357,
"preview": "```\nreleaseHeader('2010-08-11', '0.9.1', '0.9.0')\n```\n\nBugfix release for **0.9.1**. Greatly improves the handling of mi"
},
{
"path": "documentation/sections/changelog/0.9.2.md",
"chars": 764,
"preview": "```\nreleaseHeader('2010-08-23', '0.9.2', '0.9.1')\n```\n\nSpecifying the start and end of a range literal is now optional, "
},
{
"path": "documentation/sections/changelog/0.9.3.md",
"chars": 330,
"preview": "```\nreleaseHeader('2010-09-16', '0.9.3', '0.9.2')\n```\n\nCoffeeScript `switch` statements now compile into JS `switch` sta"
},
{
"path": "documentation/sections/changelog/0.9.4.md",
"chars": 369,
"preview": "```\nreleaseHeader('2010-09-21', '0.9.4', '0.9.3')\n```\n\nCoffeeScript now uses appropriately-named temporary variables, an"
},
{
"path": "documentation/sections/changelog/0.9.5.md",
"chars": 756,
"preview": "```\nreleaseHeader('2010-11-21', '0.9.5', '0.9.4')\n```\n\n0.9.5 should be considered the first release candidate for Coffee"
},
{
"path": "documentation/sections/changelog/0.9.6.md",
"chars": 581,
"preview": "```\nreleaseHeader('2010-12-06', '0.9.6', '0.9.5')\n```\n\nThe REPL now properly formats stacktraces, and stays alive throug"
},
{
"path": "documentation/sections/changelog/1.0.0.md",
"chars": 514,
"preview": "```\nreleaseHeader('2010-12-24', '1.0.0', '0.9.6')\n```\n\nCoffeeScript loops no longer try to preserve block scope when fun"
},
{
"path": "documentation/sections/changelog/1.0.1.md",
"chars": 497,
"preview": "```\nreleaseHeader('2011-01-31', '1.0.1', '1.0.0')\n```\n\nFixed a lexer bug with Unicode identifiers. Updated REPL for comp"
},
{
"path": "documentation/sections/changelog/1.1.0.md",
"chars": 823,
"preview": "```\nreleaseHeader('2011-05-01', '1.1.0', '1.0.1')\n```\n\nWhen running via the `coffee` executable, `process.argv` and frie"
},
{
"path": "documentation/sections/changelog/1.1.1.md",
"chars": 136,
"preview": "```\nreleaseHeader('2011-05-10', '1.1.1', '1.1.0')\n```\n\nBugfix release for classes with external constructor functions, s"
},
{
"path": "documentation/sections/changelog/1.1.2.md",
"chars": 504,
"preview": "```\nreleaseHeader('2011-08-04', '1.1.2', '1.1.1')\n```\n\nFixes for block comment formatting, `?=` compilation, implicit ca"
},
{
"path": "documentation/sections/changelog/1.1.3.md",
"chars": 1242,
"preview": "```\nreleaseHeader('2011-11-08', '1.1.3', '1.1.2')\n```\n\n* Ahh, whitespace. CoffeeScript’s compiled JS now tries to spac"
},
{
"path": "documentation/sections/changelog/1.10.0.md",
"chars": 675,
"preview": "```\nreleaseHeader('2015-09-03', '1.10.0', '1.9.3')\n```\n\n* CoffeeScript now supports ES2015-style destructuring default"
},
{
"path": "documentation/sections/changelog/1.11.0.md",
"chars": 2229,
"preview": "```\nreleaseHeader('2016-09-24', '1.11.0', '1.10.0')\n```\n\n* CoffeeScript now supports ES2015 [`import` and `export` syn"
},
{
"path": "documentation/sections/changelog/1.11.1.md",
"chars": 385,
"preview": "```\nreleaseHeader('2016-10-02', '1.11.1', '1.11.0')\n```\n\n* Bugfix for shorthand object syntax after interpolated keys."
},
{
"path": "documentation/sections/changelog/1.12.0.md",
"chars": 1698,
"preview": "```\nreleaseHeader('2016-12-04', '1.12.0', '1.11.1')\n```\n\n* CoffeeScript now supports ES2015 [tagged template literals]"
},
{
"path": "documentation/sections/changelog/1.12.1.md",
"chars": 729,
"preview": "```\nreleaseHeader('2016-12-07', '1.12.1', '1.12.0')\n```\n\n* You can now import a module member named `default`, e.g. `i"
},
{
"path": "documentation/sections/changelog/1.12.2.md",
"chars": 456,
"preview": "```\nreleaseHeader('2016-12-16', '1.12.2', '1.12.1')\n```\n\n* The browser compiler can once again be built unminified via"
},
{
"path": "documentation/sections/changelog/1.12.3.md",
"chars": 737,
"preview": "```\nreleaseHeader('2017-01-24', '1.12.3', '1.12.2')\n```\n\n* `@` values can now be used as indices in `for` expressions."
},
{
"path": "documentation/sections/changelog/1.12.4.md",
"chars": 584,
"preview": "```\nreleaseHeader('2017-02-18', '1.12.4', '1.12.3')\n```\n\n* The `cake` commands have been updated, with new `watch` opt"
},
{
"path": "documentation/sections/changelog/1.12.5.md",
"chars": 363,
"preview": "```\nreleaseHeader('2017-04-10', '1.12.5', '1.12.4')\n```\n\n* Better handling of `default`, `from`, `as` and `*` within `"
},
{
"path": "documentation/sections/changelog/1.12.6.md",
"chars": 876,
"preview": "```\nreleaseHeader('2017-05-15', '1.12.6', '1.12.5')\n```\n\n* The `return` and `export` keywords can now accept implicit "
},
{
"path": "documentation/sections/changelog/1.12.7.md",
"chars": 219,
"preview": "```\nreleaseHeader('2017-07-16', '1.12.7', '1.12.6')\n```\n\n* Fix regressions in 1.12.6 related to chained function calls"
},
{
"path": "documentation/sections/changelog/1.2.0.md",
"chars": 616,
"preview": "```\nreleaseHeader('2011-12-18', '1.2.0', '1.1.3')\n```\n\n* Multiple improvements to `coffee --watch` and `--join`. You m"
},
{
"path": "documentation/sections/changelog/1.3.1.md",
"chars": 1495,
"preview": "```\nreleaseHeader('2012-04-10', '1.3.1', '1.2.0')\n```\n\n* CoffeeScript now enforces all of JavaScript’s **Strict Mode**"
}
]
// ... and 221 more files (download for full content)
About this extraction
This page contains the full source code of the jashkenas/coffeescript GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 421 files (8.0 MB), approximately 2.1M tokens, and a symbol index with 1268 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.