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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10829102: Create 'unified' version of Date, with a dart2js implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Gramma fix and moved JS logic from DateImplementation to js_helpers. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 delayedPatches.forEach((String path, LibraryElement importedLibrary) { 549 delayedPatches.forEach((String path, LibraryElement importedLibrary) {
550 patchDartLibrary(importedLibrary, path); 550 patchDartLibrary(importedLibrary, path);
551 }); 551 });
552 } 552 }
553 553
554 void applyContainerPatch(ContainerElement original, Link<Element> patches, 554 void applyContainerPatch(ContainerElement original, Link<Element> patches,
555 Element lookup(SourceString name)) { 555 Element lookup(SourceString name)) {
556 while (!patches.isEmpty()) { 556 while (!patches.isEmpty()) {
557 Element patchElement = patches.head; 557 Element patchElement = patches.head;
558 Element originalElement = lookup(patchElement.name); 558 Element originalElement = lookup(patchElement.name);
559 // Getters and setters are kept inside a synthetic field. 559 if (patchElement.isAccessor()) {
560 if (patchElement.kind === ElementKind.ABSTRACT_FIELD) { 560 // Skip accessors. An accessor always has an abstract field,
561 // representing the accessor in the lookup scope. We can thus skip the
562 // accessors and just handle the abstract field.
563 } else if (patchElement.kind === ElementKind.ABSTRACT_FIELD) {
564 // Getters and setters are kept inside a synthetic field.
561 if (originalElement !== null && 565 if (originalElement !== null &&
562 originalElement.kind !== ElementKind.ABSTRACT_FIELD) { 566 originalElement.kind !== ElementKind.ABSTRACT_FIELD) {
563 internalError("Cannot patch non-getter/setter with getter/setter", 567 internalError("Cannot patch non-getter/setter with getter/setter",
564 element: originalElement); 568 element: originalElement);
565 } 569 }
566 AbstractFieldElement patchField = patchElement; 570 AbstractFieldElement patchField = patchElement;
567 AbstractFieldElement originalField = originalElement; 571 AbstractFieldElement originalField = originalElement;
568 if (patchField.getter !== null) { 572 if (patchField.getter !== null) {
569 if (originalField === null || originalField.getter === null) { 573 if (originalField === null || originalField.getter === null) {
570 original.addGetterOrSetter(clonePatch(patchField.getter), 574 original.addGetterOrSetter(clonePatch(patchField.getter),
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 final endOffset = end.charOffset + end.slowCharCount; 1095 final endOffset = end.charOffset + end.slowCharCount;
1092 1096
1093 // [begin] and [end] might be the same for the same empty token. This 1097 // [begin] and [end] might be the same for the same empty token. This
1094 // happens for instance when scanning '$$'. 1098 // happens for instance when scanning '$$'.
1095 assert(endOffset >= beginOffset); 1099 assert(endOffset >= beginOffset);
1096 return f(beginOffset, endOffset); 1100 return f(beginOffset, endOffset);
1097 } 1101 }
1098 1102
1099 String toString() => 'SourceSpan($uri, $begin, $end)'; 1103 String toString() => 'SourceSpan($uri, $begin, $end)';
1100 } 1104 }
OLDNEW
« no previous file with comments | « corelib/unified/core/implementation/date.dart ('k') | lib/compiler/implementation/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698