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

Unified Diff: pkg/js_ast/lib/src/builder.dart

Issue 1234623002: dart2js: Support natives in the startup emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Reupload Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js_ast/lib/src/builder.dart
diff --git a/pkg/js_ast/lib/src/builder.dart b/pkg/js_ast/lib/src/builder.dart
index 076ff65bb62ee4108eb004c41c6d660088123bce..67ea25c9994272a006bcd60a49e8e7dea2a1a3c7 100644
--- a/pkg/js_ast/lib/src/builder.dart
+++ b/pkg/js_ast/lib/src/builder.dart
@@ -377,6 +377,14 @@ class JsBuilder {
List<Expression> arguments) {
return new Call(new PropertyAccess(receiver, fieldName), arguments);
}
+
+ ObjectInitializer objectLiteral(Map<String, Expression> map) {
+ List<Property> properties = <Property>[];
+ map.forEach((name, value) {
+ properties.add(new Property(string(name), value));
+ });
+ return new ObjectInitializer(properties);
+ }
}
LiteralString string(String value) => js.string(value);
@@ -400,6 +408,9 @@ Call propertyCall(Expression receiver,
List<Expression> arguments) {
return js.propertyCall(receiver, fieldName, arguments);
}
+ObjectInitializer objectLiteral(Map<String, Expression> map) {
+ return js.objectLiteral(map);
+}
class MiniJsParserError {
MiniJsParserError(this.parser, this.message) { }
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698