Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 45bf215

Browse files
ochafikOlivier Chafik
authored and
Olivier Chafik
committed
Qualified exports and inheritance for Closure (fixes core.Object issue)
1 parent 3b7a6bf commit 45bf215

File tree

9 files changed

+429
-301
lines changed

9 files changed

+429
-301
lines changed

lib/runtime/dart/_interceptors.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,20 +476,20 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
476476
return JSExtendableArray;
477477
});
478478
let JSExtendableArray = JSExtendableArray$();
479-
class Interceptor extends core.Object {
480-
Interceptor() {
481-
}
482-
}
483-
dart.setSignature(Interceptor, {
484-
constructors: () => ({Interceptor: [Interceptor, []]})
485-
});
486479
let _isInt32 = Symbol('_isInt32');
487480
let _tdivFast = Symbol('_tdivFast');
488481
let _tdivSlow = Symbol('_tdivSlow');
489482
let _shlPositive = Symbol('_shlPositive');
490483
let _shrReceiverPositive = Symbol('_shrReceiverPositive');
491484
let _shrOtherPositive = Symbol('_shrOtherPositive');
492485
let _shrBothPositive = Symbol('_shrBothPositive');
486+
class Interceptor extends core.Object {
487+
Interceptor() {
488+
}
489+
}
490+
dart.setSignature(Interceptor, {
491+
constructors: () => ({Interceptor: [Interceptor, []]})
492+
});
493493
dart.defineExtensionNames([
494494
'compareTo',
495495
'isNegative',

lib/runtime/dart/_native_typed_data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
dart_library.library('dart/_native_typed_data', null, /* Imports */[
22
"dart_runtime/dart",
3-
'dart/core',
43
'dart/typed_data',
4+
'dart/core',
55
'dart/_js_helper',
66
'dart/collection',
77
'dart/_internal',
88
'dart/_interceptors',
99
'dart/math'
1010
], /* Lazy imports */[
11-
], function(exports, dart, core, typed_data, _js_helper, collection, _internal, _interceptors, math) {
11+
], function(exports, dart, typed_data, core, _js_helper, collection, _internal, _interceptors, math) {
1212
'use strict';
1313
let dartx = dart.dartx;
1414
class NativeByteBuffer extends core.Object {

lib/runtime/dart/async.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ dart_library.library('dart/async', null, /* Imports */[
6363
names: ['_getBestStackTrace']
6464
});
6565
let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.dynamic, [dart.dynamic]));
66+
let _controller = Symbol('_controller');
67+
let _subscribe = Symbol('_subscribe');
68+
let _createSubscription = Symbol('_createSubscription');
69+
let _onListen = Symbol('_onListen');
6670
let _add = Symbol('_add');
6771
let _closeUnchecked = Symbol('_closeUnchecked');
6872
let _addError = Symbol('_addError');
@@ -763,8 +767,6 @@ dart_library.library('dart/async', null, /* Imports */[
763767
return Stream;
764768
});
765769
let Stream = Stream$();
766-
let _createSubscription = Symbol('_createSubscription');
767-
let _onListen = Symbol('_onListen');
768770
let _StreamImpl$ = dart.generic(function(T) {
769771
class _StreamImpl extends Stream$(T) {
770772
_StreamImpl() {
@@ -798,8 +800,6 @@ dart_library.library('dart/async', null, /* Imports */[
798800
return _StreamImpl;
799801
});
800802
let _StreamImpl = _StreamImpl$();
801-
let _controller = Symbol('_controller');
802-
let _subscribe = Symbol('_subscribe');
803803
let _ControllerStream$ = dart.generic(function(T) {
804804
class _ControllerStream extends _StreamImpl$(T) {
805805
_ControllerStream(controller) {
@@ -855,6 +855,18 @@ dart_library.library('dart/async', null, /* Imports */[
855855
this[_previous] = null;
856856
}
857857
}
858+
let _eventState = Symbol('_eventState');
859+
let _expectsEvent = Symbol('_expectsEvent');
860+
let _toggleEventId = Symbol('_toggleEventId');
861+
let _isFiring = Symbol('_isFiring');
862+
let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring');
863+
let _removeAfterFiring = Symbol('_removeAfterFiring');
864+
let _onPause = Symbol('_onPause');
865+
let _onResume = Symbol('_onResume');
866+
let _recordCancel = Symbol('_recordCancel');
867+
let _onCancel = Symbol('_onCancel');
868+
let _recordPause = Symbol('_recordPause');
869+
let _recordResume = Symbol('_recordResume');
858870
let _zone = Symbol('_zone');
859871
let _state = Symbol('_state');
860872
let _onData = Symbol('_onData');
@@ -869,17 +881,14 @@ dart_library.library('dart/async', null, /* Imports */[
869881
let _isInputPaused = Symbol('_isInputPaused');
870882
let _inCallback = Symbol('_inCallback');
871883
let _guardCallback = Symbol('_guardCallback');
872-
let _onPause = Symbol('_onPause');
873884
let _decrementPauseCount = Symbol('_decrementPauseCount');
874885
let _hasPending = Symbol('_hasPending');
875886
let _mayResumeInput = Symbol('_mayResumeInput');
876-
let _onResume = Symbol('_onResume');
877887
let _cancel = Symbol('_cancel');
878888
let _isClosed = Symbol('_isClosed');
879889
let _waitsForCancel = Symbol('_waitsForCancel');
880890
let _canFire = Symbol('_canFire');
881891
let _cancelOnError = Symbol('_cancelOnError');
882-
let _onCancel = Symbol('_onCancel');
883892
let _incrementPauseCount = Symbol('_incrementPauseCount');
884893
let _sendData = Symbol('_sendData');
885894
let _addPending = Symbol('_addPending');
@@ -1220,9 +1229,6 @@ dart_library.library('dart/async', null, /* Imports */[
12201229
return _BufferingStreamSubscription;
12211230
});
12221231
let _BufferingStreamSubscription = _BufferingStreamSubscription$();
1223-
let _recordCancel = Symbol('_recordCancel');
1224-
let _recordPause = Symbol('_recordPause');
1225-
let _recordResume = Symbol('_recordResume');
12261232
let _ControllerSubscription$ = dart.generic(function(T) {
12271233
class _ControllerSubscription extends _BufferingStreamSubscription$(T) {
12281234
_ControllerSubscription(controller, onData, onError, onDone, cancelOnError) {
@@ -1245,12 +1251,6 @@ dart_library.library('dart/async', null, /* Imports */[
12451251
return _ControllerSubscription;
12461252
});
12471253
let _ControllerSubscription = _ControllerSubscription$();
1248-
let _eventState = Symbol('_eventState');
1249-
let _expectsEvent = Symbol('_expectsEvent');
1250-
let _toggleEventId = Symbol('_toggleEventId');
1251-
let _isFiring = Symbol('_isFiring');
1252-
let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring');
1253-
let _removeAfterFiring = Symbol('_removeAfterFiring');
12541254
let _BroadcastSubscription$ = dart.generic(function(T) {
12551255
class _BroadcastSubscription extends _ControllerSubscription$(T) {
12561256
_BroadcastSubscription(controller, onData, onError, onDone, cancelOnError) {
@@ -3542,6 +3542,7 @@ dart_library.library('dart/async', null, /* Imports */[
35423542
return _GeneratedStreamImpl;
35433543
});
35443544
let _GeneratedStreamImpl = _GeneratedStreamImpl$();
3545+
let _iterator = Symbol('_iterator');
35453546
let _eventScheduled = Symbol('_eventScheduled');
35463547
class _PendingEvents extends core.Object {
35473548
_PendingEvents() {
@@ -3582,7 +3583,6 @@ dart_library.library('dart/async', null, /* Imports */[
35823583
cancelSchedule: [dart.void, []]
35833584
})
35843585
});
3585-
let _iterator = Symbol('_iterator');
35863586
let _IterablePendingEvents$ = dart.generic(function(T) {
35873587
class _IterablePendingEvents extends _PendingEvents {
35883588
_IterablePendingEvents(data) {
@@ -5132,18 +5132,6 @@ dart_library.library('dart/async', null, /* Imports */[
51325132
}),
51335133
names: ['_enter', '_leave']
51345134
});
5135-
class _Zone extends core.Object {
5136-
_Zone() {
5137-
}
5138-
inSameErrorZone(otherZone) {
5139-
return dart.notNull(core.identical(this, otherZone)) || dart.notNull(core.identical(this.errorZone, otherZone.errorZone));
5140-
}
5141-
}
5142-
_Zone[dart.implements] = () => [Zone];
5143-
dart.setSignature(_Zone, {
5144-
constructors: () => ({_Zone: [_Zone, []]}),
5145-
methods: () => ({inSameErrorZone: [core.bool, [Zone]]})
5146-
});
51475135
let _run = Symbol('_run');
51485136
let _runUnary = Symbol('_runUnary');
51495137
let _runBinary = Symbol('_runBinary');
@@ -5159,6 +5147,18 @@ dart_library.library('dart/async', null, /* Imports */[
51595147
let _handleUncaughtError = Symbol('_handleUncaughtError');
51605148
let _map = Symbol('_map');
51615149
let _delegate = Symbol('_delegate');
5150+
class _Zone extends core.Object {
5151+
_Zone() {
5152+
}
5153+
inSameErrorZone(otherZone) {
5154+
return dart.notNull(core.identical(this, otherZone)) || dart.notNull(core.identical(this.errorZone, otherZone.errorZone));
5155+
}
5156+
}
5157+
_Zone[dart.implements] = () => [Zone];
5158+
dart.setSignature(_Zone, {
5159+
constructors: () => ({_Zone: [_Zone, []]}),
5160+
methods: () => ({inSameErrorZone: [core.bool, [Zone]]})
5161+
});
51625162
class _RootZone extends _Zone {
51635163
_RootZone() {
51645164
super._Zone();

lib/runtime/dart/collection.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dart_library.library('dart/collection', null, /* Imports */[
2222
}
2323
}
2424
dart.setSignature(UnmodifiableListView, {
25-
constructors: () => ({UnmodifiableListView: [exports.UnmodifiableListView$(E), [core.Iterable$(E)]]}),
25+
constructors: () => ({UnmodifiableListView: [UnmodifiableListView$(E), [core.Iterable$(E)]]}),
2626
methods: () => ({get: [E, [core.int]]})
2727
});
2828
dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
@@ -113,11 +113,9 @@ dart_library.library('dart/collection', null, /* Imports */[
113113
return HashMap;
114114
});
115115
let HashMap = HashMap$();
116+
let _newSet = Symbol('_newSet');
116117
let SetMixin$ = dart.generic(function(E) {
117118
class SetMixin extends core.Object {
118-
[Symbol.iterator]() {
119-
return new dart.JsIterator(this.iterator);
120-
}
121119
get isEmpty() {
122120
return this.length == 0;
123121
}
@@ -381,6 +379,9 @@ dart_library.library('dart/collection', null, /* Imports */[
381379
}
382380
dart.throw(core.RangeError.index(index, this, "index", null, elementIndex));
383381
}
382+
[Symbol.iterator]() {
383+
return new dart.JsIterator(this.iterator);
384+
}
384385
}
385386
SetMixin[dart.implements] = () => [core.Set$(E)];
386387
dart.setSignature(SetMixin, {
@@ -456,7 +457,6 @@ dart_library.library('dart/collection', null, /* Imports */[
456457
return SetBase;
457458
});
458459
let SetBase = SetBase$();
459-
let _newSet = Symbol('_newSet');
460460
let _HashSetBase$ = dart.generic(function(E) {
461461
class _HashSetBase extends SetBase$(E) {
462462
difference(other) {
@@ -1624,9 +1624,6 @@ dart_library.library('dart/collection', null, /* Imports */[
16241624
get iterator() {
16251625
return new (_internal.ListIterator$(E))(this);
16261626
}
1627-
[Symbol.iterator]() {
1628-
return new dart.JsIterator(this.iterator);
1629-
}
16301627
elementAt(index) {
16311628
return this.get(index);
16321629
}
@@ -2101,6 +2098,9 @@ dart_library.library('dart/collection', null, /* Imports */[
21012098
toString() {
21022099
return IterableBase.iterableToFullString(this, '[', ']');
21032100
}
2101+
[Symbol.iterator]() {
2102+
return new dart.JsIterator(this.iterator);
2103+
}
21042104
}
21052105
ListMixin[dart.implements] = () => [core.List$(E)];
21062106
dart.setSignature(ListMixin, {

lib/runtime/dart/convert.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dart_library.library('dart/convert', null, /* Imports */[
99
], function(exports, dart, core, async, typed_data, _internal, collection) {
1010
'use strict';
1111
let dartx = dart.dartx;
12+
let _allowInvalid = Symbol('_allowInvalid');
1213
let Codec$ = dart.generic(function(S, T) {
1314
class Codec extends core.Object {
1415
Codec() {
@@ -63,7 +64,6 @@ dart_library.library('dart/convert', null, /* Imports */[
6364
statics: () => ({getByName: [Encoding, [core.String]]}),
6465
names: ['getByName']
6566
});
66-
let _allowInvalid = Symbol('_allowInvalid');
6767
class AsciiCodec extends Encoding {
6868
AsciiCodec(opts) {
6969
let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
@@ -96,6 +96,7 @@ dart_library.library('dart/convert', null, /* Imports */[
9696
});
9797
let ASCII = dart.const(new AsciiCodec());
9898
let _ASCII_MASK = 127;
99+
let _subsetMask = Symbol('_subsetMask');
99100
let Converter$ = dart.generic(function(S, T) {
100101
class Converter extends core.Object {
101102
Converter() {
@@ -125,7 +126,6 @@ dart_library.library('dart/convert', null, /* Imports */[
125126
return Converter;
126127
});
127128
let Converter = Converter$();
128-
let _subsetMask = Symbol('_subsetMask');
129129
class _UnicodeSubsetEncoder extends Converter$(core.String, core.List$(core.int)) {
130130
_UnicodeSubsetEncoder(subsetMask) {
131131
this[_subsetMask] = subsetMask;
@@ -177,6 +177,7 @@ dart_library.library('dart/convert', null, /* Imports */[
177177
dart.setSignature(AsciiEncoder, {
178178
constructors: () => ({AsciiEncoder: [AsciiEncoder, []]})
179179
});
180+
let _sink = Symbol('_sink');
180181
class StringConversionSinkMixin extends core.Object {
181182
add(str) {
182183
return this.addSlice(str, 0, str[dartx.length], false);
@@ -197,7 +198,6 @@ dart_library.library('dart/convert', null, /* Imports */[
197198
})
198199
});
199200
class StringConversionSinkBase extends StringConversionSinkMixin {}
200-
let _sink = Symbol('_sink');
201201
class _UnicodeSubsetEncoderSink extends StringConversionSinkBase {
202202
_UnicodeSubsetEncoderSink(subsetMask, sink) {
203203
this[_subsetMask] = subsetMask;
@@ -300,6 +300,7 @@ dart_library.library('dart/convert', null, /* Imports */[
300300
constructors: () => ({AsciiDecoder: [AsciiDecoder, [], {allowInvalid: core.bool}]}),
301301
methods: () => ({startChunkedConversion: [ByteConversionSink, [core.Sink$(core.String)]]})
302302
});
303+
let _utf8Sink = Symbol('_utf8Sink');
303304
let ChunkedConversionSink$ = dart.generic(function(T) {
304305
class ChunkedConversionSink extends core.Object {
305306
ChunkedConversionSink() {
@@ -349,7 +350,6 @@ dart_library.library('dart/convert', null, /* Imports */[
349350
dart.setSignature(ByteConversionSinkBase, {
350351
methods: () => ({addSlice: [dart.void, [core.List$(core.int), core.int, core.int, core.bool]]})
351352
});
352-
let _utf8Sink = Symbol('_utf8Sink');
353353
class _ErrorHandlingAsciiDecoderSink extends ByteConversionSinkBase {
354354
_ErrorHandlingAsciiDecoderSink(utf8Sink) {
355355
this[_utf8Sink] = utf8Sink;

lib/runtime/dart/core.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,10 +1270,7 @@ dart_library.library('dart/core', null, /* Imports */[
12701270
generator = null;
12711271
if (dart.notNull(count) <= 0)
12721272
return new (_internal.EmptyIterable$(E))();
1273-
return new (exports._GeneratorIterable$(E))(count, generator);
1274-
}
1275-
[dart.JsSymbol.iterator]() {
1276-
return new dart.JsIterator(this[dartx.iterator]);
1273+
return new (_GeneratorIterable$(E))(count, generator);
12771274
}
12781275
[dartx.join](separator) {
12791276
if (separator === void 0)
@@ -1282,6 +1279,9 @@ dart_library.library('dart/core', null, /* Imports */[
12821279
buffer.writeAll(this, separator);
12831280
return dart.toString(buffer);
12841281
}
1282+
[dart.JsSymbol.iterator]() {
1283+
return new dart.JsIterator(this[dartx.iterator]);
1284+
}
12851285
}
12861286
dart.setSignature(Iterable, {
12871287
constructors: () => ({
@@ -1306,7 +1306,7 @@ dart_library.library('dart/core', null, /* Imports */[
13061306
_GeneratorIterable(end, generator) {
13071307
this[_end] = end;
13081308
this[_start] = 0;
1309-
this[_generator] = dart.as(generator != null ? generator : exports._GeneratorIterable$()._id, _Generator$(E));
1309+
this[_generator] = dart.as(generator != null ? generator : _GeneratorIterable$()._id, _Generator$(E));
13101310
super.IterableBase();
13111311
}
13121312
slice(start, end, generator) {
@@ -1328,7 +1328,7 @@ dart_library.library('dart/core', null, /* Imports */[
13281328
let newStart = dart.notNull(this[_start]) + dart.notNull(count);
13291329
if (dart.notNull(newStart) >= dart.notNull(this[_end]))
13301330
return new (_internal.EmptyIterable$(E))();
1331-
return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]);
1331+
return new (_GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]);
13321332
}
13331333
take(count) {
13341334
RangeError.checkNotNegative(count, "count");
@@ -1337,7 +1337,7 @@ dart_library.library('dart/core', null, /* Imports */[
13371337
let newEnd = dart.notNull(this[_start]) + dart.notNull(count);
13381338
if (dart.notNull(newEnd) >= dart.notNull(this[_end]))
13391339
return this;
1340-
return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]);
1340+
return new (_GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]);
13411341
}
13421342
static _id(n) {
13431343
return n;
@@ -1347,8 +1347,8 @@ dart_library.library('dart/core', null, /* Imports */[
13471347
dart.defineNamedConstructor(_GeneratorIterable, 'slice');
13481348
dart.setSignature(_GeneratorIterable, {
13491349
constructors: () => ({
1350-
_GeneratorIterable: [exports._GeneratorIterable$(E), [int, dart.functionType(E, [int])]],
1351-
slice: [exports._GeneratorIterable$(E), [int, int, _Generator$(E)]]
1350+
_GeneratorIterable: [_GeneratorIterable$(E), [int, dart.functionType(E, [int])]],
1351+
slice: [_GeneratorIterable$(E), [int, int, _Generator$(E)]]
13521352
}),
13531353
methods: () => ({
13541354
skip: [Iterable$(E), [int]],
@@ -1548,9 +1548,9 @@ dart_library.library('dart/core', null, /* Imports */[
15481548
Set[dart.implements] = () => [_internal.EfficientLength];
15491549
dart.setSignature(Set, {
15501550
constructors: () => ({
1551-
new: [exports.Set$(E), []],
1552-
identity: [exports.Set$(E), []],
1553-
from: [exports.Set$(E), [Iterable]]
1551+
new: [Set$(E), []],
1552+
identity: [Set$(E), []],
1553+
from: [Set$(E), [Iterable]]
15541554
})
15551555
});
15561556
return Set;
@@ -1729,7 +1729,7 @@ dart_library.library('dart/core', null, /* Imports */[
17291729
}
17301730
}
17311731
dart.setSignature(Runes, {
1732-
constructors: () => ({Runes: [exports.Runes, [String]]})
1732+
constructors: () => ({Runes: [Runes, [String]]})
17331733
});
17341734
dart.defineExtensionMembers(Runes, ['iterator', 'last']);
17351735
return Runes;

0 commit comments

Comments
 (0)