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

Unified Diff: lib/compiler/implementation/compiler.dart

Issue 10831125: Revert 'Port the remaining of dart:core to the unified corelib.' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 465dd24b79294039fba6849da05ba00023349edd..ca6ca2ba8cb60374a28e6029a5089e9d50e33292 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -571,7 +571,7 @@ class Compiler implements DiagnosticListener {
AbstractFieldElement originalField = originalElement;
if (patchField.getter !== null) {
if (originalField === null || originalField.getter === null) {
- original.addGetterOrSetter(clonePatch(patchField.getter, original),
+ original.addGetterOrSetter(clonePatch(patchField.getter),
originalField,
this);
if (originalField === null && patchField.setter !== null) {
@@ -584,7 +584,7 @@ class Compiler implements DiagnosticListener {
}
if (patchField.setter !== null) {
if (originalField === null || originalField.setter === null) {
- original.addGetterOrSetter(clonePatch(patchField.setter, original),
+ original.addGetterOrSetter(clonePatch(patchField.setter),
originalField,
this);
} else {
@@ -596,7 +596,7 @@ class Compiler implements DiagnosticListener {
internalError("Cannot patch non-existing member '"
"${patchElement.name.slowToString()}'.");
}
- original.addMember(clonePatch(patchElement, original), this);
+ original.addMember(clonePatch(patchElement), this);
} else {
patchMember(originalElement, patchElement);
}
@@ -610,7 +610,7 @@ class Compiler implements DiagnosticListener {
return !element.metadata.isEmpty();
}
- Element clonePatch(Element patchElement, Element enclosing) {
+ Element clonePatch(Element patchElement) {
// The original library does not have an element with the same name
// as the patch library element.
// In this case, the patch library element must not be marked as "patch",
@@ -619,23 +619,9 @@ class Compiler implements DiagnosticListener {
internalError("Cannot add non-private member '"
"${patchElement.name.slowToString()}' from patch.");
}
- if (patchElement.isFunction()) {
- var function = new FunctionElement.from(patchElement.name,
- patchElement,
- enclosing);
- // Give the cloned function a patch reference, so it gets the correct
- // compilation unit for reporting diagnostics.
- function.setPatch(patchElement);
- return function;
- } else if (patchElement.isField()) {
- // TODO(ajohnsen): Decide if a VariableElement should have a patch field.
- return new VariableElement.from(patchElement.name,
- patchElement,
- enclosing);
- }
// TODO(lrn): Create a copy of patchElement that isn't added to any
// object/library yet, but which takes its source from patchElement.
- throw "Adding ${patchElement.kind} from patch is unsupported";
+ throw "Adding members from patch is unsupported";
}
void patchMember(Element originalElement, Element patchElement) {
« no previous file with comments | « corelib/unified/core/implementation/stopwatch.dart ('k') | lib/compiler/implementation/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698