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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 15858005: Implement get/set field in library and class mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 3f2cb333d963031f4833e5fd9aa7553ebe3506ef..54ded9ccb8f91461f6e0e48d135941013ed13e2d 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -1565,6 +1565,7 @@ class CodeEmitterTask extends CompilerTask {
}
emitIsTests(classElement, builder);
+ // TODO(ahe): This method (generateClass) should return a jsAst.Expression.
if (!buffer.isEmpty) {
buffer.write(',$n$n');
}
@@ -1782,6 +1783,8 @@ class CodeEmitterTask extends CompilerTask {
void emitStaticFunction(CodeBuffer buffer,
String name,
jsAst.Expression functionExpression) {
+ // TODO(ahe): This method (emitStaticFunction) should return a
+ // jsAst.Expression.
if (!buffer.isEmpty) {
buffer.write(',$n$n');
}
@@ -1829,7 +1832,8 @@ class CodeEmitterTask extends CompilerTask {
for (FunctionElement element in
Elements.sortedByPosition(staticGetters.keys)) {
Element closure = staticGetters[element];
- // CodeBuffer buffer = bufferForElement(element, eagerBuffer);
+ // TODO(ahe): This should be emitted as a constant. Currently,
+ // this breaks deferred loading.
CodeBuffer buffer = eagerBuffer;
String closureClass = namer.isolateAccess(closure);
String name = namer.getStaticClosureName(element);
@@ -3213,22 +3217,32 @@ const String HOOKS_API_USAGE = """
""";
// TODO(ahe): This code should be integrated in finishClasses.
+// TODO(ahe): The uri field below is fake.
const String REFLECTION_DATA_PARSER = r'''
(function (reflectionData) {
+ if (!init.libraries) init.libraries = [];
+ var libraries = init.libraries;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var length = reflectionData.length;
for (var i = 0; i < length; i++) {
var data = reflectionData[i];
var name = data[0];
var descriptor = data[1];
+ var classes = [];
+ var functions = [];
for (var property in descriptor) {
if (!hasOwnProperty.call(descriptor, property)) continue;
var element = descriptor[property];
if (typeof element === "function") {
$[property] = element;
+ functions.push(property);
} else {
$$[property] = element;
+ classes.push(property);
+ classes.push(element[""]);
}
}
+ var uri = ".../library" + i + ".dart";
+ libraries.push([name, uri, classes, functions]);
}
})''';

Powered by Google App Engine
This is Rietveld 408576698