| 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 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2322 if (!meth.isGenerated && !meth.get$isAbstract() && meth.get$definition() != nu
ll) { | 2322 if (!meth.isGenerated && !meth.get$isAbstract() && meth.get$definition() != nu
ll) { |
| 2323 new MethodGenerator(meth, enclosingMethod).run(); | 2323 new MethodGenerator(meth, enclosingMethod).run(); |
| 2324 } | 2324 } |
| 2325 } | 2325 } |
| 2326 WorldGenerator.prototype._prototypeOf = function(type, name) { | 2326 WorldGenerator.prototype._prototypeOf = function(type, name) { |
| 2327 if (type.get$isSingletonNative()) { | 2327 if (type.get$isSingletonNative()) { |
| 2328 return ('' + type.get$jsname() + '.' + name); | 2328 return ('' + type.get$jsname() + '.' + name); |
| 2329 } | 2329 } |
| 2330 else if (type.get$isHiddenNativeType()) { | 2330 else if (type.get$isHiddenNativeType()) { |
| 2331 this.corejs.ensureDynamicProto(); | 2331 this.corejs.ensureDynamicProto(); |
| 2332 return ('\$dynamic("' + name + '").' + type.get$jsname()); | 2332 return ('\$dynamic("' + name + '").' + type.get$definition().get$nativeType(
).get$name()); |
| 2333 } | 2333 } |
| 2334 else { | 2334 else { |
| 2335 return ('' + type.get$jsname() + '.prototype.' + name); | 2335 return ('' + type.get$jsname() + '.prototype.' + name); |
| 2336 } | 2336 } |
| 2337 } | 2337 } |
| 2338 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) { | 2338 WorldGenerator.prototype._maybeIsTest = function(onType, checkType) { |
| 2339 var isSubtype = onType.isSubtypeOf(checkType); | 2339 var isSubtype = onType.isSubtypeOf(checkType); |
| 2340 if (checkType.isTested) { | 2340 if (checkType.isTested) { |
| 2341 this.writer.writeln(this._prototypeOf(onType, ('is\$' + checkType.get$jsname
())) + (' = function(){return ' + isSubtype + '};')); | 2341 this.writer.writeln(this._prototypeOf(onType, ('is\$' + checkType.get$jsname
())) + (' = function(){return ' + isSubtype + '};')); |
| 2342 } | 2342 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2363 return; | 2363 return; |
| 2364 } | 2364 } |
| 2365 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; | 2365 var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level'; |
| 2366 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); | 2366 this.writer.comment(('// ********** Code for ' + typeName + ' **************')
); |
| 2367 if (type.get$isNative() && !type.get$isTop()) { | 2367 if (type.get$isNative() && !type.get$isTop()) { |
| 2368 var nativeName = type.get$definition().get$nativeType().get$name(); | 2368 var nativeName = type.get$definition().get$nativeType().get$name(); |
| 2369 if ($eq(nativeName, '')) { | 2369 if ($eq(nativeName, '')) { |
| 2370 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); | 2370 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
| 2371 } | 2371 } |
| 2372 else if (type.get$jsname() != nativeName) { | 2372 else if (type.get$jsname() != nativeName) { |
| 2373 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';')); | 2373 if (type.get$isHiddenNativeType()) { |
| 2374 this.writer.writeln(('function ' + type.get$jsname() + '() {}')); |
| 2375 } |
| 2376 else { |
| 2377 this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'))
; |
| 2378 } |
| 2374 } | 2379 } |
| 2375 } | 2380 } |
| 2376 if (!type.get$isTop()) { | 2381 if (!type.get$isTop()) { |
| 2377 if ((type instanceof ConcreteType)) { | 2382 if ((type instanceof ConcreteType)) { |
| 2378 var c = type; | 2383 var c = type; |
| 2379 this.corejs.ensureInheritsHelper(); | 2384 this.corejs.ensureInheritsHelper(); |
| 2380 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType
.get$jsname() + ');')); | 2385 this.writer.writeln(('\$inherits(' + c.get$jsname() + ', ' + c.genericType
.get$jsname() + ');')); |
| 2381 for (var p = c._parent; | 2386 for (var p = c._parent; |
| 2382 (p instanceof ConcreteType); p = p.get$_parent()) { | 2387 (p instanceof ConcreteType); p = p.get$_parent()) { |
| 2383 this._ensureInheritMembersHelper(); | 2388 this._ensureInheritMembersHelper(); |
| (...skipping 11049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13433 } | 13438 } |
| 13434 var const$0 = new EnvMap()/*const EnvMap()*/; | 13439 var const$0 = new EnvMap()/*const EnvMap()*/; |
| 13435 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/; | 13440 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/; |
| 13436 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/; | 13441 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/; |
| 13437 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; | 13442 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; |
| 13438 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; | 13443 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; |
| 13439 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | 13444 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; |
| 13440 var $globals = {}; | 13445 var $globals = {}; |
| 13441 $static_init(); | 13446 $static_init(); |
| 13442 main(); | 13447 main(); |
| OLD | NEW |