Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: tool/input_sdk/private/ddc_runtime/operations.dart

Issue 1988023008: Name and hoist types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Try again Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// This library defines runtime operations on objects used by the code 5 /// This library defines runtime operations on objects used by the code
6 /// generator. 6 /// generator.
7 part of dart._runtime; 7 part of dart._runtime;
8 8
9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => { 9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => {
10 $name = $canonicalMember($obj, $name); 10 $name = $canonicalMember($obj, $name);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 invocation.namedArguments); 549 invocation.namedArguments);
550 } 550 }
551 // Delegate to the (possibly user-defined) method on the object. 551 // Delegate to the (possibly user-defined) method on the object.
552 var extension = getExtensionType(obj); 552 var extension = getExtensionType(obj);
553 if (extension != null) { 553 if (extension != null) {
554 return JS('', '#[dartx.noSuchMethod](#)', obj, invocation); 554 return JS('', '#[dartx.noSuchMethod](#)', obj, invocation);
555 } 555 }
556 return JS('', '#.noSuchMethod(#)', obj, invocation); 556 return JS('', '#.noSuchMethod(#)', obj, invocation);
557 } 557 }
558 558
559 constFn(x) => JS('', '() => x');
560
559 runtimeType(obj) { 561 runtimeType(obj) {
560 // Handle primitives where the method isn't on the object. 562 // Handle primitives where the method isn't on the object.
561 var result = _checkPrimitiveType(obj); 563 var result = _checkPrimitiveType(obj);
562 if (result != null) return wrapType(result); 564 if (result != null) return wrapType(result);
563 565
564 // Delegate to the (possibly user-defined) method on the object. 566 // Delegate to the (possibly user-defined) method on the object.
565 var extension = getExtensionType(obj); 567 var extension = getExtensionType(obj);
566 if (extension != null) { 568 if (extension != null) {
567 return JS('', '#[dartx.runtimeType]', obj); 569 return JS('', '#[dartx.runtimeType]', obj);
568 } 570 }
(...skipping 17 matching lines...) Expand all
586 constructor(dartIterator) { 588 constructor(dartIterator) {
587 this.dartIterator = dartIterator; 589 this.dartIterator = dartIterator;
588 } 590 }
589 next() { 591 next() {
590 let i = this.dartIterator; 592 let i = this.dartIterator;
591 let done = !i.moveNext(); 593 let done = !i.moveNext();
592 return { done: done, value: done ? void 0 : i.current }; 594 return { done: done, value: done ? void 0 : i.current };
593 } 595 }
594 } 596 }
595 '''); 597 ''');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698