Removed __splice in the same manner

This commit is contained in:
matehat
2010-03-30 18:14:51 -04:00
parent ca9e45e8af
commit c498b7090e
4 changed files with 9 additions and 12 deletions

View File

@@ -546,8 +546,10 @@ exports.SliceNode: class SliceNode extends BaseNode
from: if @range.from? then @range.from else literal('null')
to: if @range.to? then @range.to else literal('null')
exclusive: if @range.exclusive then 'true' else 'false'
ref: new ValueNode literal(o.scope.utility('splice'))
call: new CallNode ref, [literal(array), from, to, literal(exclusive), replace]
v: o.scope.free_variable()
rng: new CallNode new ValueNode(literal(o.scope.utility('range'))), [literal(array), from, to, literal(exclusive)]
args: literal "[($v = ${rng.compile(o)})[0], $v[1] - $v[0]].concat(${replace.compile(o)})"
call: new CallNode new ValueNode(literal(array), [literal('.splice.apply')]), [literal(array), args]
call.compile(o)
compile_slice: (o) ->