You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coffeescript test suite errors after parser build? #3750
failed 9 and passed 579 tests in 3.56 seconds
parser error formating
AssertionError: Expected [stdin]:1:15: error: unexpected in
foo in bar or in baz
^^ to equal TypeError: Cannot read property '0' of undefined
function () {
return assertErrorFormat('foo in bar or in baz', '[stdin]:1:15: error: unexpected in\nfoo in bar or in baz\n ^^');
}
compiler error formatting with mixed tab and space
AssertionError: Expected [stdin]:1:4: error: unexpected if
if a
^^ to equal TypeError: Cannot read property '0' of undefined
function () {
return assertErrorFormat("\t if a\n\t test", '[stdin]:1:4: error: unexpected if\n\t if a\n\t ^^');
}
#2849: compilation error in a require()d file
AssertionError: Expected /Users/macbookpro/Apps/coffeescript/test/syntax-error.coffee:1:15: error: unexpected in
foo in bar or in baz
^^ to equal TypeError: Cannot read property '0' of undefined
function () {
ok(!fs.existsSync('test/syntax-error.coffee'));
fs.writeFileSync('test/syntax-error.coffee', 'foo in bar or in baz');
try {
return assertErrorFormat('require \'./test/syntax-error\'', "" + (path.join(__dirname, 'syntax-error.coffee')) + ":1:15: error: unexpected in\nfoo in bar or in baz\n ^^");
} finally {
fs.unlink('test/syntax-error.coffee');
}
}
#1096: unexpected generated tokens
AssertionError: Expected [stdin]:1:3: error: unexpected string interpolation
{"#{key}": val}
^^ to equal TypeError: Cannot read property '0' of undefined
function () {
assertErrorFormat('{"#{key}": val}', '[stdin]:1:3: error: unexpected string interpolation\n{"#{key}": val}\n ^^');
assertErrorFormat('a:, b', '[stdin]:1:3: error: unexpected ,\na:, b\n ^');
assertErrorFormat('(a:)', '[stdin]:1:4: error: unexpected )\n(a:)\n ^');
assertErrorFormat('a:', '[stdin]:1:3: error: unexpected end of input\na:\n ^');
return assertErrorFormat('for i in [1]:\n 1', '[stdin]:1:13: error: unexpected :\nfor i in [1]:\n ^');
}
#3325: implicit indentation errors
AssertionError: Expected [stdin]:1:14: error: unexpected then
i for i in a then i
^^^^ to equal TypeError: Cannot read property '0' of undefined
function () {
return assertErrorFormat('i for i in a then i', '[stdin]:1:14: error: unexpected then\ni for i in a then i\n ^^^^');
}
explicit indentation errors
AssertionError: Expected [stdin]:2:1: error: unexpected indentation
c
^^ to equal TypeError: Cannot read property '0' of undefined
function () {
return assertErrorFormat('a = b\n c', '[stdin]:2:1: error: unexpected indentation\n c\n^^');
}
CoffeeScript.eval can run in, and modify, a Script context sandbox
TypeError: undefined is not a function
at Function.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:13:25)
at global.test (/Users/macbookpro/Apps/coffeescript/Cakefile:276:12)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:12:3)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:1:1)
at Module._compile (module.js:449:26)
function () {
var code, result, sandbox;
sandbox = vm.Script.createContext();
sandbox.foo = 'bar';
code = 'global.foo = \'not bar!\'';
result = CoffeeScript["eval"](code, {
sandbox: sandbox
});
eq(result, 'not bar!');
return eq(sandbox.foo, 'not bar!');
}
CoffeeScript.eval can run in, but cannot modify, an ordinary object sandbox
TypeError: undefined is not a function
at Object.exports.eval (/Users/macbookpro/Apps/coffeescript/lib/coffee-script/coffee-script.js:133:47)
at Function.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:27:14)
at global.test (/Users/macbookpro/Apps/coffeescript/Cakefile:276:12)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:22:3)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/eval.coffee:1:1)
at Module._compile (module.js:449:26)
function () {
var code, result, sandbox;
sandbox = {
foo: 'bar'
};
code = 'global.foo = \'not bar!\'';
result = CoffeeScript["eval"](code, {
sandbox: sandbox
});
eq(result, 'not bar!');
return eq(sandbox.foo, 'bar');
}
keeps running after runtime error
AssertionError: Expected 0 to equal -1
at global.eq (/Users/macbookpro/Apps/coffeescript/Cakefile:313:65)
at /Users/macbookpro/Apps/coffeescript/test/repl.coffee:106:28
at Function.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/repl.coffee:38:17)
at global.test (/Users/macbookpro/Apps/coffeescript/Cakefile:276:12)
at testRepl (/Users/macbookpro/Apps/coffeescript/test/repl.coffee:38:8)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/repl.coffee:104:1)
at Object.<anonymous> (/Users/macbookpro/Apps/coffeescript/test/repl.coffee:1:1)
at Module._compile (module.js:449:26)
function () {
return fn(input, output, repl);
}
Activity
jashkenas commentedon Dec 3, 2014
Perhaps you have a newer version of Jison installed? And we need to update?
Can you investigate the nature of the errors?
GabrielRatener commentedon Dec 3, 2014
Here is the output from the tests:
Using Jison v0.4.15
lydell commentedon Jan 15, 2015
Fixed by #3794.
kid-wumeng commentedon Oct 19, 2016
@lydell Thank you very much ! It's nice !