mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Merge branch 'master' of github.com:jashkenas/coffeescript into 2
This commit is contained in:
commit
5cf8256d2e
4 changed files with 7 additions and 5 deletions
|
@ -3033,9 +3033,10 @@
|
|||
};
|
||||
|
||||
Op.prototype.compileFloorDivision = function(o) {
|
||||
var div, floor;
|
||||
var div, floor, second;
|
||||
floor = new Value(new IdentifierLiteral('Math'), [new Access(new PropertyName('floor'))]);
|
||||
div = new Op('/', this.first, this.second);
|
||||
second = this.second.isComplex() ? new Parens(this.second) : this.second;
|
||||
div = new Op('/', this.first, second);
|
||||
return new Call(floor, [div]).compileToFragments(o);
|
||||
};
|
||||
|
||||
|
|
|
@ -2077,7 +2077,8 @@ exports.Op = class Op extends Base
|
|||
|
||||
compileFloorDivision: (o) ->
|
||||
floor = new Value new IdentifierLiteral('Math'), [new Access new PropertyName 'floor']
|
||||
div = new Op '/', @first, @second
|
||||
second = if @second.isComplex() then new Parens @second else @second
|
||||
div = new Op '/', @first, second
|
||||
new Call(floor, [div]).compileToFragments o
|
||||
|
||||
compileModulo: (o) ->
|
||||
|
|
|
@ -416,7 +416,7 @@ test "#3795: invalid escapes", ->
|
|||
assertErrorFormat '''
|
||||
///a \\u002 0 space///
|
||||
''', '''
|
||||
[stdin]:1:6: error: invalid escape sequence \\u002
|
||||
[stdin]:1:6: error: invalid escape sequence \\u002 \n\
|
||||
///a \\u002 0 space///
|
||||
^\^^^^^
|
||||
'''
|
||||
|
|
|
@ -330,7 +330,7 @@ test "floor division operator", ->
|
|||
|
||||
test "floor division operator compound assignment", ->
|
||||
a = 7
|
||||
a //= 2
|
||||
a //= 1 + 1
|
||||
eq 3, a
|
||||
|
||||
test "modulo operator", ->
|
||||
|
|
Loading…
Add table
Reference in a new issue