Simplify Call.prototype.compileSplat based on how Traceur does it

This commit is contained in:
Simon Sturmer
2012-10-16 21:05:31 +07:00
parent d8905e2f87
commit 25bdde85a9

View File

@@ -606,8 +606,8 @@ exports.Call = class Call extends Base
return """
(function(func, args, ctor) {
#{idt}ctor.prototype = func.prototype;
#{idt}var child = new ctor, result = func.apply(child, args), t = typeof result;
#{idt}return t == "object" || t == "function" ? result || child : child;
#{idt}var child = new ctor, result = func.apply(child, args);
#{idt}return Object(result) === result ? result : child;
#{@tab}})(#{ @variable.compile o, LEVEL_LIST }, #{splatArgs}, function(){})
"""
base = new Value @variable