Merge branch 'master' into 2

# Conflicts:
#	Cakefile
#	documentation/sections/changelog.md
#	documentation/sections/classes.md
#	documentation/sections/fat_arrow.md
#	documentation/sections/installation.md
#	documentation/sections/introduction.md
#	documentation/sections/resources.md
#	documentation/sections/scripts.md
#	lib/coffeescript/repl.js
#	src/lexer.coffee
This commit is contained in:
Geoffrey Booth 2017-04-17 19:52:34 -07:00
commit ae096a331a
4 changed files with 16 additions and 6 deletions

View File

@ -116,7 +116,7 @@ task 'build:full', 'build the CoffeeScript compiler from source twice, and run t
build ->
build testBuiltCode
task 'build:browser', 'build the merged script for inclusion in the browser', ->
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"};
@ -162,6 +162,9 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
outputFolder = "docs/v#{majorVersion}/browser-compiler"
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
fs.writeFileSync "#{outputFolder}/coffeescript.js", header + '\n' + code
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'
@ -339,7 +342,7 @@ task 'doc:source:watch', 'watch and continually rebuild the annotated source doc
task 'release', 'build and test the CoffeeScript source, and build the documentation', ->
invoke 'build:full'
invoke 'build:browser'
invoke 'build:browser:full'
invoke 'doc:site'
invoke 'doc:test'
invoke 'doc:source'
@ -429,7 +432,8 @@ runTests = (CoffeeScript) ->
task 'test', 'run the CoffeeScript language test suite', ->
runTests CoffeeScript
testResults = runTests CoffeeScript
process.exit 1 unless testResults
task 'test:browser', 'run the test suite against the merged browser script', ->
@ -437,4 +441,5 @@ task 'test:browser', 'run the test suite against the merged browser script', ->
result = {}
global.testingBrowser = yes
(-> eval source).call result
runTests result.CoffeeScript
testResults = runTests result.CoffeeScript
process.exit 1 unless testResults

View File

@ -170,7 +170,7 @@
start: function(opts = {}) {
var build, major, minor, repl;
[major, minor, build] = process.versions.node.split('.').map(function(n) {
return parseInt(n);
return parseInt(n, 10);
});
if (major < 6) {
console.warn("Node 6+ required for CoffeeScript REPL");

View File

@ -145,7 +145,7 @@ getCommandId = (repl, commandName) ->
module.exports =
start: (opts = {}) ->
[major, minor, build] = process.versions.node.split('.').map (n) -> parseInt(n)
[major, minor, build] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
if major < 6
console.warn "Node 6+ required for CoffeeScript REPL"

View File

@ -69,6 +69,11 @@ testRepl "variables are saved", (input, output) ->
eq "'foobar'", output.lastWrite()
testRepl "empty command evaluates to undefined", (input, output) ->
# A regression fixed in Node 5.11.0 broke the handling of pressing enter in
# the Node REPL; see https://github.com/nodejs/node/pull/6090 and
# https://github.com/jashkenas/coffeescript/issues/4502.
# Just skip this test for versions of Node < 6.
return if parseInt(process.versions.node.split('.')[0], 10) < 6
input.emitLine ''
eq 'undefined', output.lastWrite()