mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
rebuilt parser and rewrote the asserts wrapping loop in Cakefile using do =>
This commit is contained in:
parent
9619fa66eb
commit
abef3f59be
4 changed files with 9 additions and 8 deletions
4
Cakefile
4
Cakefile
|
@ -99,8 +99,8 @@ task 'loc', 'count the lines of source code in the CoffeeScript compiler', ->
|
|||
runTests = (CoffeeScript) ->
|
||||
startTime = Date.now()
|
||||
passedTests = failedTests = 0
|
||||
wrap = (name, func) -> global[name] = -> ++passedTests; func arguments...
|
||||
wrap name, func for all name, func of require 'assert'
|
||||
for all name, func of require 'assert' then do (name, func) =>
|
||||
global[name] = -> ++passedTests; func arguments...
|
||||
global.eq = global.strictEqual
|
||||
global.CoffeeScript = CoffeeScript
|
||||
process.on 'exit', ->
|
||||
|
|
|
@ -1053,7 +1053,7 @@
|
|||
this.bound = false;
|
||||
return new Call(new Value(this, [new Accessor(new Literal('call'))]), [new Literal('this')].concat(this.params));
|
||||
} else {
|
||||
return new Call(this, this.params);
|
||||
return new Call(this);
|
||||
}
|
||||
};
|
||||
return Code;
|
||||
|
|
|
@ -115,7 +115,7 @@ case 52:this.$ = new yy.Comment($$[$0-1+1-1]);
|
|||
break;
|
||||
case 53:this.$ = new yy.Existence($$[$0-2+1-1]);
|
||||
break;
|
||||
case 54:this.$ = new yy.Call($$[$0-2+2-1], $$[$0-2+2-1].params);
|
||||
case 54:this.$ = $$[$0-2+2-1]["do"]();
|
||||
break;
|
||||
case 55:this.$ = new yy.Code($$[$0-5+2-1], $$[$0-5+5-1], $$[$0-5+4-1]);
|
||||
break;
|
||||
|
|
|
@ -889,14 +889,15 @@ exports.Code = class Code extends Base
|
|||
# Short-circuit `traverseChildren` method to prevent it from crossing scope boundaries
|
||||
# unless `crossScope` is `true`.
|
||||
traverseChildren: (crossScope, func) -> super(crossScope, func) if crossScope
|
||||
|
||||
|
||||
# Automatically calls the defined function.
|
||||
do: ->
|
||||
if @bound
|
||||
@bound = no
|
||||
new Call(new Value this, [new Accessor new Literal 'call']
|
||||
[new Literal 'this'].concat this.params)
|
||||
else new Call this, this.params
|
||||
new Call new Value(this, [new Accessor new Literal 'call']),
|
||||
[new Literal 'this'].concat this.params
|
||||
else
|
||||
new Call this
|
||||
|
||||
#### Param
|
||||
|
||||
|
|
Loading…
Reference in a new issue