| OLD | NEW |
| 1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
| 2 // ********** Library dart:core ************** | 2 // ********** Library dart:core ************** |
| 3 // ********** Natives dart:core ************** | 3 // ********** Natives dart:core ************** |
| 4 /** | 4 /** |
| 5 * Generates a dynamic call stub for a function. | 5 * Generates a dynamic call stub for a function. |
| 6 * Our goal is to create a stub method like this on-the-fly: | 6 * Our goal is to create a stub method like this on-the-fly: |
| 7 * function($0, $1, capture) { return this($0, $1, true, capture); } | 7 * function($0, $1, capture) { return this($0, $1, true, capture); } |
| 8 * | 8 * |
| 9 * This stub then replaces the dynamic one on Function, with one that is | 9 * This stub then replaces the dynamic one on Function, with one that is |
| 10 * specialized for that particular function, taking into account its default | 10 * specialized for that particular function, taking into account its default |
| (...skipping 5390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5401 this.declaringType.genMethod(this); | 5401 this.declaringType.genMethod(this); |
| 5402 this._provideOptionalParamInfo = true; | 5402 this._provideOptionalParamInfo = true; |
| 5403 if (this.isStatic) { | 5403 if (this.isStatic) { |
| 5404 this.declaringType.markUsed(); | 5404 this.declaringType.markUsed(); |
| 5405 var type = this.declaringType.get$isTop() ? '' : ('' + this.declaringType.ge
t$jsname() + '.'); | 5405 var type = this.declaringType.get$isTop() ? '' : ('' + this.declaringType.ge
t$jsname() + '.'); |
| 5406 return new Value(this.get$functionType(), ('' + type + this.get$jsname()), n
ode.span, true); | 5406 return new Value(this.get$functionType(), ('' + type + this.get$jsname()), n
ode.span, true); |
| 5407 } | 5407 } |
| 5408 this._providePropertySyntax = true; | 5408 this._providePropertySyntax = true; |
| 5409 return new Value(this.get$functionType(), ('' + target.code + '.get\$' + this.
get$jsname() + '()'), node.span, true); | 5409 return new Value(this.get$functionType(), ('' + target.code + '.get\$' + this.
get$jsname() + '()'), node.span, true); |
| 5410 } | 5410 } |
| 5411 MethodMember.prototype.namesInHomePositions = function(args) { |
| 5412 if (!args.get$hasNames()) return true; |
| 5413 for (var i = args.get$bareCount(); |
| 5414 i < args.values.length; i++) { |
| 5415 if (i >= this.parameters.length) return false; |
| 5416 if (args.getName(i) != this.parameters.$index(i).get$name()) return false; |
| 5417 } |
| 5418 return true; |
| 5419 } |
| 5411 MethodMember.prototype.namesInOrder = function(args) { | 5420 MethodMember.prototype.namesInOrder = function(args) { |
| 5412 if (!args.get$hasNames()) return true; | 5421 if (!args.get$hasNames()) return true; |
| 5413 var lastParameter = null; | 5422 var lastParameter = null; |
| 5414 for (var i = args.get$bareCount(); | 5423 for (var i = args.get$bareCount(); |
| 5415 i < this.parameters.length; i++) { | 5424 i < this.parameters.length; i++) { |
| 5416 var p = args.getIndexOfName(this.parameters.$index(i).get$name()); | 5425 var p = args.getIndexOfName(this.parameters.$index(i).get$name()); |
| 5417 if (p >= 0 && args.values.$index(p).get$needsTemp()) { | 5426 if (p >= 0 && args.values.$index(p).get$needsTemp()) { |
| 5418 if (lastParameter != null && lastParameter > p) { | 5427 if (lastParameter != null && lastParameter > p) { |
| 5419 return false; | 5428 return false; |
| 5420 } | 5429 } |
| (...skipping 7647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13068 var method = this.member; | 13077 var method = this.member; |
| 13069 if (method.needsArgumentConversion(args)) { | 13078 if (method.needsArgumentConversion(args)) { |
| 13070 return false; | 13079 return false; |
| 13071 } | 13080 } |
| 13072 for (var i = args.get$length(); | 13081 for (var i = args.get$length(); |
| 13073 i < method.parameters.length; i++) { | 13082 i < method.parameters.length; i++) { |
| 13074 if ($ne(method.parameters.$index(i).get$value().get$code(), 'null')) { | 13083 if ($ne(method.parameters.$index(i).get$value().get$code(), 'null')) { |
| 13075 return false; | 13084 return false; |
| 13076 } | 13085 } |
| 13077 } | 13086 } |
| 13078 return method.namesInOrder(args); | 13087 return method.namesInHomePositions(args); |
| 13079 } | 13088 } |
| 13080 else { | 13089 else { |
| 13081 return false; | 13090 return false; |
| 13082 } | 13091 } |
| 13083 } | 13092 } |
| 13084 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; | 13093 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; |
| 13085 // ********** Code for VarMethodSet ************** | 13094 // ********** Code for VarMethodSet ************** |
| 13086 $inherits(VarMethodSet, VarMember); | 13095 $inherits(VarMethodSet, VarMember); |
| 13087 function VarMethodSet(baseName, name, members, callArgs, returnType) { | 13096 function VarMethodSet(baseName, name, members, callArgs, returnType) { |
| 13088 this.invoked = false | 13097 this.invoked = false |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13242 return success; | 13251 return success; |
| 13243 } | 13252 } |
| 13244 var options; | 13253 var options; |
| 13245 function parseOptions(homedir, args, files) { | 13254 function parseOptions(homedir, args, files) { |
| 13246 $globals.options = new FrogOptions(homedir, args, files); | 13255 $globals.options = new FrogOptions(homedir, args, files); |
| 13247 } | 13256 } |
| 13248 function _getCallStubName(name, args) { | 13257 function _getCallStubName(name, args) { |
| 13249 var nameBuilder = new StringBufferImpl(('' + name + '\$' + args.get$bareCount(
))); | 13258 var nameBuilder = new StringBufferImpl(('' + name + '\$' + args.get$bareCount(
))); |
| 13250 for (var i = args.get$bareCount(); | 13259 for (var i = args.get$bareCount(); |
| 13251 i < args.get$length(); i++) { | 13260 i < args.get$length(); i++) { |
| 13252 nameBuilder.add('\$').add(args.getName(i)); | 13261 var name0 = args.getName(i); |
| 13262 nameBuilder.add('\$'); |
| 13263 if (name0.contains$1('\$')) { |
| 13264 nameBuilder.add(('' + name0.length)); |
| 13265 } |
| 13266 nameBuilder.add(name0); |
| 13253 } | 13267 } |
| 13254 return nameBuilder.toString(); | 13268 return nameBuilder.toString(); |
| 13255 } | 13269 } |
| 13256 // ********** Library minfrog ************** | 13270 // ********** Library minfrog ************** |
| 13257 // ********** Code for top level ************** | 13271 // ********** Code for top level ************** |
| 13258 function main() { | 13272 function main() { |
| 13259 var homedir = path.dirname(fs.realpathSync(process.argv.$index(1))); | 13273 var homedir = path.dirname(fs.realpathSync(process.argv.$index(1))); |
| 13260 var argv = []; | 13274 var argv = []; |
| 13261 for (var i = 0; | 13275 for (var i = 0; |
| 13262 i < process.argv.length; i++) { | 13276 i < process.argv.length; i++) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13306 $globals._NO_COLOR = '\u001b[0m'; | 13320 $globals._NO_COLOR = '\u001b[0m'; |
| 13307 $globals._RED_COLOR = '\u001b[31m'; | 13321 $globals._RED_COLOR = '\u001b[31m'; |
| 13308 } | 13322 } |
| 13309 var const$0 = new EnvMap()/*const EnvMap()*/; | 13323 var const$0 = new EnvMap()/*const EnvMap()*/; |
| 13310 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; | 13324 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; |
| 13311 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; | 13325 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; |
| 13312 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | 13326 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; |
| 13313 var $globals = {}; | 13327 var $globals = {}; |
| 13314 $static_init(); | 13328 $static_init(); |
| 13315 main(); | 13329 main(); |
| OLD | NEW |