Skip to content

Commit

Permalink
Breaking Change: Support @js at library level
Browse files Browse the repository at this point in the history
R=jacobr@google.com
TBR=asiva@google.com, jacobr@google.com

Review URL: https://codereview.chromium.org/1871573002 .
  • Loading branch information
terrylucas committed Apr 12, 2016
1 parent 4a704cc commit 7146915
Show file tree
Hide file tree
Showing 12 changed files with 3,300 additions and 3,283 deletions.
6,560 changes: 3,280 additions & 3,280 deletions sdk/lib/js/dartium/cached_patches.dart

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions sdk/lib/js/dartium/js_dartium.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_anonymous2_exp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Same test as js_typed_interop_anonymous2, but using the
// --experimental-trust-js-interop-type-annotations flag.
@JS()
library js_typed_interop_anonymous2_exp_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_anonymous2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@JS()
library js_typed_interop_anonymous2_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_anonymous_exp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Same test as js_typed_interop_anonymous, but using the
// --experimental-trust-js-interop-type-annotations flag.
@JS()
library js_typed_interop_anonymous_exp_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_anonymous_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@JS()
library js_typed_interop_anonymous_test;

import 'dart:html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Same test as js_typed_interop_anonymous_unreachable, but using the
// --experimental-trust-js-interop-type-annotations flag.
@JS()
library js_typed_interop_anonymous_unreachable_exp_test;

import 'dart:html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@JS()
library js_typed_interop_anonymous_unreachable_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_side_cast_exp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Similar test to js_typed_interop_side_cast, but because we are using the
// --experimental-trust-js-interop-type-annotations flag, we test a slighly
// different behavior.
@JS()
library js_typed_interop_side_cast_exp_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/js_typed_interop_side_cast_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@JS()
library js_typed_interop_anonymous2_test;

import 'dart:html';
Expand Down
1 change: 1 addition & 0 deletions tests/html/mirrors_js_typed_interop_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@JS()
library tests.html.mirrors_js_typed_interop_test;

import 'dart:mirrors';
Expand Down
2 changes: 1 addition & 1 deletion tools/deps/dartium.deps/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ execfile(os.path.join(path, 'src', 'dart', 'tools', 'deps', 'dartium.deps', 'DEP

vars.update({
"dartium_chromium_commit": "d70bedf071e56a6bb1d8ad0df8ece98745e0401a",
"dartium_webkit_commit": "71e6557949a5ab3406f04af7cb6689acb3b235e8",
"dartium_webkit_commit": "b4483b1ace5b28b4678cf132087db9cd9e18deb6",
"chromium_base_revision": "338390",

# We use mirrors of all github repos to guarantee reproducibility and
Expand Down

0 comments on commit 7146915

Please sign in to comment.