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

Unified Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 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: pkg/compiler/lib/src/js_emitter/native_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index d819a28717bf22bf9970aa24674e5de2db219557..3e7b649676770d60300c45f1c7aa0a9de03c6eff 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -194,15 +194,19 @@ class NativeEmitter {
if (nonleafStr != '') {
sb..write(';')..write(nonleafStr);
}
- if (extensions != null) {
- sb..write(';')
- ..writeAll(extensions.map((Class cls) => cls.name), '|');
- }
+
String encoding = sb.toString();
- if (cls.isNative || encoding != '') {
+ if (cls.isNative || encoding != '' || extensions != null) {
+ List<jsAst.Literal> parts = <jsAst.Literal>[js.stringPart(encoding)];
+ if (extensions != null) {
+ parts..add(js.stringPart(';'))
+ ..addAll(
+ js.joinLiterals(extensions.map((Class cls) => cls.name),
+ js.stringPart('|')));
+ }
assert(cls.nativeInfo == null);
- cls.nativeInfo = encoding;
+ cls.nativeInfo = js.concatenateStrings(parts, addQuotes: true);
}
}
generateClassInfo(jsInterceptorClass);
@@ -301,7 +305,7 @@ class NativeEmitter {
List<jsAst.Statement> generateParameterStubStatements(
FunctionElement member,
bool isInterceptedMethod,
- String invocationName,
+ jsAst.Name invocationName,
List<jsAst.Parameter> stubParameters,
List<jsAst.Expression> argumentsBuffer,
int indexOfLastOptionalArgumentInParameters) {

Powered by Google App Engine
This is Rietveld 408576698