Skip to content

Commit c139653

Browse files
committed
Check for duplicate library names
This bites us on Angular - dart:collection and angular's collection (facade) lib smash on top of each other, silently causing issues. We'll need a better naming convention - perhaps we should use the lib name and require uniqueness. Fixes #208 [email protected] Review URL: https://codereview.chromium.org/1145243013
1 parent a7adab2 commit c139653

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+394
-274
lines changed

pkg/dev_compiler/lib/runtime/dart/_foreign_helper.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
var _foreign_helper = dart.defineLibrary(_foreign_helper, {});
2-
var core = dart.import(core);
3-
(function(exports, core) {
1+
dart.library('dart/_foreign_helper', null, /* Imports */[
2+
'dart/core'
3+
], /* Lazy imports */[
4+
], function(exports, core) {
45
'use strict';
56
function JS(typeDescription, codeTemplate, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) {
67
if (arg0 === void 0)
@@ -156,4 +157,4 @@ var core = dart.import(core);
156157
exports.JS_EFFECT = JS_EFFECT;
157158
exports.JS_CONST = JS_CONST;
158159
exports.JS_STRING_CONCAT = JS_STRING_CONCAT;
159-
})(_foreign_helper, core);
160+
});

pkg/dev_compiler/lib/runtime/dart/_interceptors.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var _interceptors = dart.defineLibrary(_interceptors, {});
2-
var core = dart.import(core);
3-
var _internal = dart.import(_internal);
4-
var _js_helper = dart.lazyImport(_js_helper);
5-
var collection = dart.import(collection);
6-
var math = dart.import(math);
7-
(function(exports, core, _internal, _js_helper, collection, math) {
1+
dart.library('dart/_interceptors', null, /* Imports */[
2+
'dart/core',
3+
'dart/_internal',
4+
'dart/collection',
5+
'dart/math'
6+
], /* Lazy imports */[
7+
'dart/_js_helper'
8+
], function(exports, core, _internal, collection, math, _js_helper) {
89
'use strict';
910
let JSArray$ = dart.generic(function(E) {
1011
dart.defineExtensionNames([
@@ -1543,4 +1544,4 @@ var math = dart.import(math);
15431544
exports.JavaScriptObject = JavaScriptObject;
15441545
exports.PlainJavaScriptObject = PlainJavaScriptObject;
15451546
exports.UnknownJavaScriptObject = UnknownJavaScriptObject;
1546-
})(_interceptors, core, _internal, _js_helper, collection, math);
1547+
});

pkg/dev_compiler/lib/runtime/dart/_internal.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var _internal = dart.defineLibrary(_internal, {});
2-
var core = dart.import(core);
3-
var collection = dart.import(collection);
4-
var math = dart.lazyImport(math);
5-
var _interceptors = dart.lazyImport(_interceptors);
6-
var _js_primitives = dart.lazyImport(_js_primitives);
7-
(function(exports, core, collection, math, _interceptors, _js_primitives) {
1+
dart.library('dart/_internal', null, /* Imports */[
2+
'dart/core',
3+
'dart/collection'
4+
], /* Lazy imports */[
5+
'dart/math',
6+
'dart/_interceptors',
7+
'dart/_js_primitives'
8+
], function(exports, core, collection, math, _interceptors, _js_primitives) {
89
'use strict';
910
class EfficientLength extends core.Object {}
1011
let ListIterable$ = dart.generic(function(E) {
@@ -2451,4 +2452,4 @@ var _js_primitives = dart.lazyImport(_js_primitives);
24512452
exports.Sort = Sort;
24522453
exports.Symbol = Symbol;
24532454
exports.POWERS_OF_TEN = POWERS_OF_TEN;
2454-
})(_internal, core, collection, math, _interceptors, _js_primitives);
2455+
});

pkg/dev_compiler/lib/runtime/dart/_isolate_helper.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
var _isolate_helper = dart.defineLibrary(_isolate_helper, {});
2-
var core = dart.import(core);
3-
var _native_typed_data = dart.import(_native_typed_data);
4-
var _interceptors = dart.import(_interceptors);
5-
var _js_helper = dart.import(_js_helper);
6-
var isolate = dart.import(isolate);
7-
var _foreign_helper = dart.import(_foreign_helper);
8-
var _js_embedded_names = dart.import(_js_embedded_names);
9-
var collection = dart.import(collection);
10-
var async = dart.import(async);
11-
(function(exports, core, _native_typed_data, _interceptors, _js_helper, isolate, _foreign_helper, _js_embedded_names, collection, async) {
1+
dart.library('dart/_isolate_helper', null, /* Imports */[
2+
'dart/core',
3+
'dart/_native_typed_data',
4+
'dart/_interceptors',
5+
'dart/_js_helper',
6+
'dart/isolate',
7+
'dart/_foreign_helper',
8+
'dart/_js_embedded_names',
9+
'dart/collection',
10+
'dart/async'
11+
], /* Lazy imports */[
12+
], function(exports, core, _native_typed_data, _interceptors, _js_helper, isolate, _foreign_helper, _js_embedded_names, collection, async) {
1213
'use strict';
1314
function _serializeMessage(message) {
1415
return new _Serializer().serialize(message);
@@ -1557,4 +1558,4 @@ var async = dart.import(async);
15571558
exports.TimerImpl = TimerImpl;
15581559
exports.hasTimer = hasTimer;
15591560
exports.CapabilityImpl = CapabilityImpl;
1560-
})(_isolate_helper, core, _native_typed_data, _interceptors, _js_helper, isolate, _foreign_helper, _js_embedded_names, collection, async);
1561+
});

pkg/dev_compiler/lib/runtime/dart/_js_embedded_names.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
var _js_embedded_names = dart.defineLibrary(_js_embedded_names, {});
2-
(function(exports) {
1+
dart.library('dart/_js_embedded_names', null, /* Imports */[
2+
], /* Lazy imports */[
3+
], function(exports) {
34
'use strict';
45
let DISPATCH_PROPERTY_NAME = "dispatchPropertyName";
56
let TYPE_INFORMATION = 'typeInformation';
@@ -64,4 +65,4 @@ var _js_embedded_names = dart.defineLibrary(_js_embedded_names, {});
6465
exports.TYPEDEF_PREDICATE_PROPERTY_NAME = TYPEDEF_PREDICATE_PROPERTY_NAME;
6566
exports.NATIVE_SUPERCLASS_TAG_NAME = NATIVE_SUPERCLASS_TAG_NAME;
6667
exports.MAP_TYPE_TO_INTERCEPTOR = MAP_TYPE_TO_INTERCEPTOR;
67-
})(_js_embedded_names);
68+
});

pkg/dev_compiler/lib/runtime/dart/_js_helper.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
var _js_helper = dart.defineLibrary(_js_helper, {});
2-
var core = dart.import(core);
3-
var collection = dart.import(collection);
4-
var _interceptors = dart.lazyImport(_interceptors);
5-
var _foreign_helper = dart.import(_foreign_helper);
6-
(function(exports, core, collection, _interceptors, _foreign_helper) {
1+
dart.library('dart/_js_helper', null, /* Imports */[
2+
'dart/core',
3+
'dart/collection',
4+
'dart/_foreign_helper'
5+
], /* Lazy imports */[
6+
'dart/_interceptors'
7+
], function(exports, core, collection, _foreign_helper, _interceptors) {
78
'use strict';
89
class NoThrows extends core.Object {
910
NoThrows() {
@@ -1202,4 +1203,4 @@ var _foreign_helper = dart.import(_foreign_helper);
12021203
exports.RuntimeError = RuntimeError;
12031204
exports.random64 = random64;
12041205
exports.jsonEncodeNative = jsonEncodeNative;
1205-
})(_js_helper, core, collection, _interceptors, _foreign_helper);
1206+
});

pkg/dev_compiler/lib/runtime/dart/_js_primitives.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
var _js_primitives = dart.defineLibrary(_js_primitives, {});
2-
var core = dart.import(core);
3-
(function(exports, core) {
1+
dart.library('dart/_js_primitives', null, /* Imports */[
2+
'dart/core'
3+
], /* Lazy imports */[
4+
], function(exports, core) {
45
'use strict';
56
function printString(string) {
67
if (typeof dartPrint == "function") {
@@ -23,4 +24,4 @@ var core = dart.import(core);
2324
dart.fn(printString, dart.void, [core.String]);
2425
// Exports:
2526
exports.printString = printString;
26-
})(_js_primitives, core);
27+
});

pkg/dev_compiler/lib/runtime/dart/_native_typed_data.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
var _native_typed_data = dart.defineLibrary(_native_typed_data, {});
2-
var core = dart.import(core);
3-
var typed_data = dart.import(typed_data);
4-
var collection = dart.import(collection);
5-
var _internal = dart.import(_internal);
6-
var _interceptors = dart.lazyImport(_interceptors);
7-
var _js_helper = dart.import(_js_helper);
8-
var math = dart.import(math);
9-
(function(exports, core, typed_data, collection, _internal, _interceptors, _js_helper, math) {
1+
dart.library('dart/_native_typed_data', null, /* Imports */[
2+
'dart/core',
3+
'dart/typed_data',
4+
'dart/collection',
5+
'dart/_internal',
6+
'dart/_js_helper',
7+
'dart/math'
8+
], /* Lazy imports */[
9+
'dart/_interceptors'
10+
], function(exports, core, typed_data, collection, _internal, _js_helper, math, _interceptors) {
1011
'use strict';
1112
class NativeByteBuffer extends core.Object {
1213
NativeByteBuffer() {
@@ -1928,4 +1929,4 @@ var math = dart.import(math);
19281929
exports.NativeFloat32x4 = NativeFloat32x4;
19291930
exports.NativeInt32x4 = NativeInt32x4;
19301931
exports.NativeFloat64x2 = NativeFloat64x2;
1931-
})(_native_typed_data, core, typed_data, collection, _internal, _interceptors, _js_helper, math);
1932+
});

pkg/dev_compiler/lib/runtime/dart/async.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var async = dart.defineLibrary(async, {});
2-
var core = dart.import(core);
3-
var _internal = dart.import(_internal);
4-
var _isolate_helper = dart.lazyImport(_isolate_helper);
5-
var _js_helper = dart.import(_js_helper);
6-
var collection = dart.import(collection);
7-
(function(exports, core, _internal, _isolate_helper, _js_helper, collection) {
1+
dart.library('dart/async', null, /* Imports */[
2+
'dart/core',
3+
'dart/_internal',
4+
'dart/_js_helper',
5+
'dart/collection'
6+
], /* Lazy imports */[
7+
'dart/_isolate_helper'
8+
], function(exports, core, _internal, _js_helper, collection, _isolate_helper) {
89
'use strict';
910
function _invokeErrorHandler(errorHandler, error, stackTrace) {
1011
if (dart.is(errorHandler, ZoneBinaryCallback)) {
@@ -5906,4 +5907,4 @@ var collection = dart.import(collection);
59065907
exports.ZoneDelegate = ZoneDelegate;
59075908
exports.Zone = Zone;
59085909
exports.runZoned = runZoned;
5909-
})(async, core, _internal, _isolate_helper, _js_helper, collection);
5910+
});

pkg/dev_compiler/lib/runtime/dart/collection.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
var collection = dart.defineLibrary(collection, {});
2-
var _internal = dart.lazyImport(_internal);
3-
var core = dart.import(core);
4-
var _js_helper = dart.lazyImport(_js_helper);
5-
var math = dart.lazyImport(math);
6-
(function(exports, _internal, core, _js_helper, math) {
1+
dart.library('dart/collection', null, /* Imports */[
2+
'dart/core'
3+
], /* Lazy imports */[
4+
'dart/_internal',
5+
'dart/_js_helper',
6+
'dart/math'
7+
], function(exports, core, _internal, _js_helper, math) {
78
'use strict';
89
let _source = Symbol('_source');
910
let UnmodifiableListView$ = dart.generic(function(E) {
@@ -6015,4 +6016,4 @@ var math = dart.lazyImport(math);
60156016
exports.LinkedHashSetCell = LinkedHashSetCell;
60166017
exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
60176018
exports.LinkedHashSetIterator = LinkedHashSetIterator;
6018-
})(collection, _internal, core, _js_helper, math);
6019+
});

pkg/dev_compiler/lib/runtime/dart/convert.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var convert = dart.defineLibrary(convert, {});
2-
var core = dart.import(core);
3-
var async = dart.import(async);
4-
var typed_data = dart.import(typed_data);
5-
var _internal = dart.import(_internal);
6-
var collection = dart.import(collection);
7-
(function(exports, core, async, typed_data, _internal, collection) {
1+
dart.library('dart/convert', null, /* Imports */[
2+
'dart/core',
3+
'dart/async',
4+
'dart/typed_data',
5+
'dart/_internal',
6+
'dart/collection'
7+
], /* Lazy imports */[
8+
], function(exports, core, async, typed_data, _internal, collection) {
89
'use strict';
910
let Codec$ = dart.generic(function(S, T) {
1011
class Codec extends core.Object {
@@ -2897,4 +2898,4 @@ var collection = dart.import(collection);
28972898
exports.UTF8 = UTF8;
28982899
exports.Utf8Encoder = Utf8Encoder;
28992900
exports.Utf8Decoder = Utf8Decoder;
2900-
})(convert, core, async, typed_data, _internal, collection);
2901+
});

pkg/dev_compiler/lib/runtime/dart/core.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var core = dart.defineLibrary(core, {});
2-
var _js_helper = dart.lazyImport(_js_helper);
3-
var _internal = dart.lazyImport(_internal);
4-
var collection = dart.lazyImport(collection);
5-
var _interceptors = dart.lazyImport(_interceptors);
6-
var convert = dart.lazyImport(convert);
7-
(function(exports, _js_helper, _internal, collection, _interceptors, convert) {
1+
dart.library('dart/core', null, /* Imports */[
2+
], /* Lazy imports */[
3+
'dart/_js_helper',
4+
'dart/_internal',
5+
'dart/collection',
6+
'dart/_interceptors',
7+
'dart/convert'
8+
], function(exports, _js_helper, _internal, collection, _interceptors, convert) {
89
'use strict';
910
class Object {
1011
constructor() {
@@ -3363,4 +3364,4 @@ var convert = dart.lazyImport(convert);
33633364
exports.Symbol = Symbol;
33643365
exports.Type = Type;
33653366
exports.Uri = Uri;
3366-
})(core, _js_helper, _internal, collection, _interceptors, convert);
3367+
});

pkg/dev_compiler/lib/runtime/dart/isolate.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var isolate = dart.defineLibrary(isolate, {});
2-
var core = dart.import(core);
3-
var _isolate_helper = dart.lazyImport(_isolate_helper);
4-
var async = dart.import(async);
5-
(function(exports, core, _isolate_helper, async) {
1+
dart.library('dart/isolate', null, /* Imports */[
2+
'dart/core',
3+
'dart/async'
4+
], /* Lazy imports */[
5+
'dart/_isolate_helper'
6+
], function(exports, core, async, _isolate_helper) {
67
'use strict';
78
class Capability extends core.Object {
89
static new() {
@@ -259,4 +260,4 @@ var async = dart.import(async);
259260
exports.ReceivePort = ReceivePort;
260261
exports.RawReceivePort = RawReceivePort;
261262
exports.RemoteError = RemoteError;
262-
})(isolate, core, _isolate_helper, async);
263+
});

pkg/dev_compiler/lib/runtime/dart/math.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
var math = dart.defineLibrary(math, {});
2-
var core = dart.import(core);
3-
var _js_helper = dart.lazyImport(_js_helper);
4-
(function(exports, core, _js_helper) {
1+
dart.library('dart/math', null, /* Imports */[
2+
'dart/core'
3+
], /* Lazy imports */[
4+
'dart/_js_helper'
5+
], function(exports, core, _js_helper) {
56
'use strict';
67
class _JenkinsSmiHash extends core.Object {
78
static combine(hash, value) {
@@ -521,4 +522,4 @@ var _js_helper = dart.lazyImport(_js_helper);
521522
exports.sqrt = sqrt;
522523
exports.exp = exp;
523524
exports.log = log;
524-
})(math, core, _js_helper);
525+
});

pkg/dev_compiler/lib/runtime/dart/typed_data.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
var typed_data = dart.defineLibrary(typed_data, {});
2-
var core = dart.import(core);
3-
var _native_typed_data = dart.lazyImport(_native_typed_data);
4-
(function(exports, core, _native_typed_data) {
1+
dart.library('dart/typed_data', null, /* Imports */[
2+
'dart/core'
3+
], /* Lazy imports */[
4+
'dart/_native_typed_data'
5+
], function(exports, core, _native_typed_data) {
56
'use strict';
67
class ByteBuffer extends core.Object {}
78
class TypedData extends core.Object {}
@@ -977,4 +978,4 @@ var _native_typed_data = dart.lazyImport(_native_typed_data);
977978
exports.Float32x4 = Float32x4;
978979
exports.Int32x4 = Int32x4;
979980
exports.Float64x2 = Float64x2;
980-
})(typed_data, core, _native_typed_data);
981+
});

0 commit comments

Comments
 (0)