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

Unified Diff: sdk/lib/js/dartium/js_dartium.dart

Issue 1871573002: Breaking Change: Support @JS at library level (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Updated to WebKit updated tests Created 4 years, 8 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 | « sdk/lib/js/dartium/cached_patches.dart ('k') | tests/html/js_typed_interop_anonymous2_exp_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/js/dartium/js_dartium.dart
diff --git a/sdk/lib/js/dartium/js_dartium.dart b/sdk/lib/js/dartium/js_dartium.dart
index 610ec2242e04977813e966f1a47a3ab9c7e686fe..0d964257af0a2cf5af244cc90e5ea37edc875710 100644
--- a/sdk/lib/js/dartium/js_dartium.dart
+++ b/sdk/lib/js/dartium/js_dartium.dart
@@ -506,9 +506,11 @@ List<String> _generateExternalMethods(List<String> libraryPaths) {
mirrors.currentMirrorSystem().libraries.forEach((uri, library) {
var library_name = "${uri.scheme}:${uri.path}";
if (cached_patches.containsKey(library_name)) {
+ // Use the pre-generated patch files for DOM dart:nnnn libraries.
var patch = cached_patches[library_name];
staticCodegen.addAll(patch);
- } else {
+ } else if (_hasJsName(library)) {
+ // Library marked with @JS
_generateLibraryCodegen(uri, library, staticCodegen);
}
}); // End of library foreach
@@ -532,7 +534,13 @@ _generateLibraryCodegen(uri, library, staticCodegen) {
var sb = new StringBuffer();
String jsLibraryName = _getJsName(library);
- library.declarations.forEach((name, declaration) {
+
+ // Sort by patch file by its declaration name.
+ var sortedDeclKeys = library.declarations.keys.toList();
+ sortedDeclKeys.sort((a, b) => mirrors.MirrorSystem.getName(a).compareTo(mirrors.MirrorSystem.getName(b)));
+
+ sortedDeclKeys.forEach((name) {
+ var declaration = library.declarations[name];
if (declaration is mirrors.MethodMirror) {
if ((_hasJsName(declaration) || jsLibraryName != null) &&
_isExternal(declaration)) {
« no previous file with comments | « sdk/lib/js/dartium/cached_patches.dart ('k') | tests/html/js_typed_interop_anonymous2_exp_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698