Skip to content

Commit

Permalink
Merge pull request #319 from dart-lang/closure-qualify
Browse files Browse the repository at this point in the history
Qualified exports and inheritance for Closure
  • Loading branch information
John Messerly committed Sep 25, 2015
2 parents a37cfad + 58f1ca9 commit 2d5525f
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 299 deletions.
10 changes: 5 additions & 5 deletions pkg/dev_compiler/lib/runtime/dart/_interceptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,18 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
return JSExtendableArray;
});
let JSExtendableArray = JSExtendableArray$();
let _isInt32 = Symbol('_isInt32');
let _tdivSlow = Symbol('_tdivSlow');
let _shlPositive = Symbol('_shlPositive');
let _shrOtherPositive = Symbol('_shrOtherPositive');
let _shrBothPositive = Symbol('_shrBothPositive');
class Interceptor extends core.Object {
Interceptor() {
}
}
dart.setSignature(Interceptor, {
constructors: () => ({Interceptor: [Interceptor, []]})
});
let _isInt32 = Symbol('_isInt32');
let _tdivSlow = Symbol('_tdivSlow');
let _shlPositive = Symbol('_shlPositive');
let _shrOtherPositive = Symbol('_shrOtherPositive');
let _shrBothPositive = Symbol('_shrBothPositive');
dart.defineExtensionNames([
'compareTo',
'isNegative',
Expand Down
4 changes: 2 additions & 2 deletions pkg/dev_compiler/lib/runtime/dart/_native_typed_data.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
dart_library.library('dart/_native_typed_data', null, /* Imports */[
"dart_runtime/dart",
'dart/core',
'dart/typed_data',
'dart/core',
'dart/_js_helper',
'dart/collection',
'dart/_internal',
'dart/_interceptors',
'dart/math'
], /* Lazy imports */[
], function(exports, dart, core, typed_data, _js_helper, collection, _internal, _interceptors, math) {
], function(exports, dart, typed_data, core, _js_helper, collection, _internal, _interceptors, math) {
'use strict';
let dartx = dart.dartx;
class NativeByteBuffer extends core.Object {
Expand Down
58 changes: 29 additions & 29 deletions pkg/dev_compiler/lib/runtime/dart/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ dart_library.library('dart/async', null, /* Imports */[
names: ['_getBestStackTrace']
});
let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.dynamic, [dart.dynamic]));
let _controller = Symbol('_controller');
let _subscribe = Symbol('_subscribe');
let _createSubscription = Symbol('_createSubscription');
let _onListen = Symbol('_onListen');
let _add = Symbol('_add');
let _closeUnchecked = Symbol('_closeUnchecked');
let _addError = Symbol('_addError');
Expand Down Expand Up @@ -763,8 +767,6 @@ dart_library.library('dart/async', null, /* Imports */[
return Stream;
});
let Stream = Stream$();
let _createSubscription = Symbol('_createSubscription');
let _onListen = Symbol('_onListen');
let _StreamImpl$ = dart.generic(function(T) {
class _StreamImpl extends Stream$(T) {
_StreamImpl() {
Expand Down Expand Up @@ -798,8 +800,6 @@ dart_library.library('dart/async', null, /* Imports */[
return _StreamImpl;
});
let _StreamImpl = _StreamImpl$();
let _controller = Symbol('_controller');
let _subscribe = Symbol('_subscribe');
let _ControllerStream$ = dart.generic(function(T) {
class _ControllerStream extends _StreamImpl$(T) {
_ControllerStream(controller) {
Expand Down Expand Up @@ -855,6 +855,18 @@ dart_library.library('dart/async', null, /* Imports */[
this[_previous] = null;
}
}
let _eventState = Symbol('_eventState');
let _expectsEvent = Symbol('_expectsEvent');
let _toggleEventId = Symbol('_toggleEventId');
let _isFiring = Symbol('_isFiring');
let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring');
let _removeAfterFiring = Symbol('_removeAfterFiring');
let _onPause = Symbol('_onPause');
let _onResume = Symbol('_onResume');
let _recordCancel = Symbol('_recordCancel');
let _onCancel = Symbol('_onCancel');
let _recordPause = Symbol('_recordPause');
let _recordResume = Symbol('_recordResume');
let _zone = Symbol('_zone');
let _state = Symbol('_state');
let _onData = Symbol('_onData');
Expand All @@ -869,17 +881,14 @@ dart_library.library('dart/async', null, /* Imports */[
let _isInputPaused = Symbol('_isInputPaused');
let _inCallback = Symbol('_inCallback');
let _guardCallback = Symbol('_guardCallback');
let _onPause = Symbol('_onPause');
let _decrementPauseCount = Symbol('_decrementPauseCount');
let _hasPending = Symbol('_hasPending');
let _mayResumeInput = Symbol('_mayResumeInput');
let _onResume = Symbol('_onResume');
let _cancel = Symbol('_cancel');
let _isClosed = Symbol('_isClosed');
let _waitsForCancel = Symbol('_waitsForCancel');
let _canFire = Symbol('_canFire');
let _cancelOnError = Symbol('_cancelOnError');
let _onCancel = Symbol('_onCancel');
let _incrementPauseCount = Symbol('_incrementPauseCount');
let _sendData = Symbol('_sendData');
let _addPending = Symbol('_addPending');
Expand Down Expand Up @@ -1220,9 +1229,6 @@ dart_library.library('dart/async', null, /* Imports */[
return _BufferingStreamSubscription;
});
let _BufferingStreamSubscription = _BufferingStreamSubscription$();
let _recordCancel = Symbol('_recordCancel');
let _recordPause = Symbol('_recordPause');
let _recordResume = Symbol('_recordResume');
let _ControllerSubscription$ = dart.generic(function(T) {
class _ControllerSubscription extends _BufferingStreamSubscription$(T) {
_ControllerSubscription(controller, onData, onError, onDone, cancelOnError) {
Expand All @@ -1245,12 +1251,6 @@ dart_library.library('dart/async', null, /* Imports */[
return _ControllerSubscription;
});
let _ControllerSubscription = _ControllerSubscription$();
let _eventState = Symbol('_eventState');
let _expectsEvent = Symbol('_expectsEvent');
let _toggleEventId = Symbol('_toggleEventId');
let _isFiring = Symbol('_isFiring');
let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring');
let _removeAfterFiring = Symbol('_removeAfterFiring');
let _BroadcastSubscription$ = dart.generic(function(T) {
class _BroadcastSubscription extends _ControllerSubscription$(T) {
_BroadcastSubscription(controller, onData, onError, onDone, cancelOnError) {
Expand Down Expand Up @@ -3543,6 +3543,7 @@ dart_library.library('dart/async', null, /* Imports */[
return _GeneratedStreamImpl;
});
let _GeneratedStreamImpl = _GeneratedStreamImpl$();
let _iterator = Symbol('_iterator');
let _eventScheduled = Symbol('_eventScheduled');
class _PendingEvents extends core.Object {
_PendingEvents() {
Expand Down Expand Up @@ -3583,7 +3584,6 @@ dart_library.library('dart/async', null, /* Imports */[
cancelSchedule: [dart.void, []]
})
});
let _iterator = Symbol('_iterator');
let _IterablePendingEvents$ = dart.generic(function(T) {
class _IterablePendingEvents extends _PendingEvents {
_IterablePendingEvents(data) {
Expand Down Expand Up @@ -5133,18 +5133,6 @@ dart_library.library('dart/async', null, /* Imports */[
}),
names: ['_enter', '_leave']
});
class _Zone extends core.Object {
_Zone() {
}
inSameErrorZone(otherZone) {
return dart.notNull(core.identical(this, otherZone)) || dart.notNull(core.identical(this.errorZone, otherZone.errorZone));
}
}
_Zone[dart.implements] = () => [Zone];
dart.setSignature(_Zone, {
constructors: () => ({_Zone: [_Zone, []]}),
methods: () => ({inSameErrorZone: [core.bool, [Zone]]})
});
let _run = Symbol('_run');
let _runUnary = Symbol('_runUnary');
let _runBinary = Symbol('_runBinary');
Expand All @@ -5160,6 +5148,18 @@ dart_library.library('dart/async', null, /* Imports */[
let _handleUncaughtError = Symbol('_handleUncaughtError');
let _map = Symbol('_map');
let _delegate = Symbol('_delegate');
class _Zone extends core.Object {
_Zone() {
}
inSameErrorZone(otherZone) {
return dart.notNull(core.identical(this, otherZone)) || dart.notNull(core.identical(this.errorZone, otherZone.errorZone));
}
}
_Zone[dart.implements] = () => [Zone];
dart.setSignature(_Zone, {
constructors: () => ({_Zone: [_Zone, []]}),
methods: () => ({inSameErrorZone: [core.bool, [Zone]]})
});
class _RootZone extends _Zone {
_RootZone() {
super._Zone();
Expand Down
16 changes: 8 additions & 8 deletions pkg/dev_compiler/lib/runtime/dart/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dart_library.library('dart/collection', null, /* Imports */[
}
}
dart.setSignature(UnmodifiableListView, {
constructors: () => ({UnmodifiableListView: [exports.UnmodifiableListView$(E), [core.Iterable$(E)]]}),
constructors: () => ({UnmodifiableListView: [UnmodifiableListView$(E), [core.Iterable$(E)]]}),
methods: () => ({get: [E, [core.int]]})
});
dart.defineExtensionMembers(UnmodifiableListView, ['get', 'length']);
Expand Down Expand Up @@ -113,11 +113,9 @@ dart_library.library('dart/collection', null, /* Imports */[
return HashMap;
});
let HashMap = HashMap$();
let _newSet = Symbol('_newSet');
let SetMixin$ = dart.generic(function(E) {
class SetMixin extends core.Object {
[Symbol.iterator]() {
return new dart.JsIterator(this.iterator);
}
get isEmpty() {
return this.length == 0;
}
Expand Down Expand Up @@ -381,6 +379,9 @@ dart_library.library('dart/collection', null, /* Imports */[
}
dart.throw(core.RangeError.index(index, this, "index", null, elementIndex));
}
[Symbol.iterator]() {
return new dart.JsIterator(this.iterator);
}
}
SetMixin[dart.implements] = () => [core.Set$(E)];
dart.setSignature(SetMixin, {
Expand Down Expand Up @@ -456,7 +457,6 @@ dart_library.library('dart/collection', null, /* Imports */[
return SetBase;
});
let SetBase = SetBase$();
let _newSet = Symbol('_newSet');
let _HashSetBase$ = dart.generic(function(E) {
class _HashSetBase extends SetBase$(E) {
difference(other) {
Expand Down Expand Up @@ -1624,9 +1624,6 @@ dart_library.library('dart/collection', null, /* Imports */[
get iterator() {
return new (_internal.ListIterator$(E))(this);
}
[Symbol.iterator]() {
return new dart.JsIterator(this.iterator);
}
elementAt(index) {
return this.get(index);
}
Expand Down Expand Up @@ -2101,6 +2098,9 @@ dart_library.library('dart/collection', null, /* Imports */[
toString() {
return IterableBase.iterableToFullString(this, '[', ']');
}
[Symbol.iterator]() {
return new dart.JsIterator(this.iterator);
}
}
ListMixin[dart.implements] = () => [core.List$(E)];
dart.setSignature(ListMixin, {
Expand Down
8 changes: 4 additions & 4 deletions pkg/dev_compiler/lib/runtime/dart/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dart_library.library('dart/convert', null, /* Imports */[
], function(exports, dart, core, async, typed_data, _internal, collection) {
'use strict';
let dartx = dart.dartx;
let _allowInvalid = Symbol('_allowInvalid');
let Codec$ = dart.generic(function(S, T) {
class Codec extends core.Object {
Codec() {
Expand Down Expand Up @@ -63,7 +64,6 @@ dart_library.library('dart/convert', null, /* Imports */[
statics: () => ({getByName: [Encoding, [core.String]]}),
names: ['getByName']
});
let _allowInvalid = Symbol('_allowInvalid');
class AsciiCodec extends Encoding {
AsciiCodec(opts) {
let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
Expand Down Expand Up @@ -96,6 +96,7 @@ dart_library.library('dart/convert', null, /* Imports */[
});
let ASCII = dart.const(new AsciiCodec());
let _ASCII_MASK = 127;
let _subsetMask = Symbol('_subsetMask');
let Converter$ = dart.generic(function(S, T) {
class Converter extends core.Object {
Converter() {
Expand Down Expand Up @@ -125,7 +126,6 @@ dart_library.library('dart/convert', null, /* Imports */[
return Converter;
});
let Converter = Converter$();
let _subsetMask = Symbol('_subsetMask');
class _UnicodeSubsetEncoder extends Converter$(core.String, core.List$(core.int)) {
_UnicodeSubsetEncoder(subsetMask) {
this[_subsetMask] = subsetMask;
Expand Down Expand Up @@ -177,6 +177,7 @@ dart_library.library('dart/convert', null, /* Imports */[
dart.setSignature(AsciiEncoder, {
constructors: () => ({AsciiEncoder: [AsciiEncoder, []]})
});
let _sink = Symbol('_sink');
class StringConversionSinkMixin extends core.Object {
add(str) {
return this.addSlice(str, 0, str[dartx.length], false);
Expand All @@ -197,7 +198,6 @@ dart_library.library('dart/convert', null, /* Imports */[
})
});
class StringConversionSinkBase extends StringConversionSinkMixin {}
let _sink = Symbol('_sink');
class _UnicodeSubsetEncoderSink extends StringConversionSinkBase {
_UnicodeSubsetEncoderSink(subsetMask, sink) {
this[_subsetMask] = subsetMask;
Expand Down Expand Up @@ -300,6 +300,7 @@ dart_library.library('dart/convert', null, /* Imports */[
constructors: () => ({AsciiDecoder: [AsciiDecoder, [], {allowInvalid: core.bool}]}),
methods: () => ({startChunkedConversion: [ByteConversionSink, [core.Sink$(core.String)]]})
});
let _utf8Sink = Symbol('_utf8Sink');
let ChunkedConversionSink$ = dart.generic(function(T) {
class ChunkedConversionSink extends core.Object {
ChunkedConversionSink() {
Expand Down Expand Up @@ -349,7 +350,6 @@ dart_library.library('dart/convert', null, /* Imports */[
dart.setSignature(ByteConversionSinkBase, {
methods: () => ({addSlice: [dart.void, [core.List$(core.int), core.int, core.int, core.bool]]})
});
let _utf8Sink = Symbol('_utf8Sink');
class _ErrorHandlingAsciiDecoderSink extends ByteConversionSinkBase {
_ErrorHandlingAsciiDecoderSink(utf8Sink) {
this[_utf8Sink] = utf8Sink;
Expand Down
26 changes: 13 additions & 13 deletions pkg/dev_compiler/lib/runtime/dart/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,7 @@ dart_library.library('dart/core', null, /* Imports */[
generator = null;
if (dart.notNull(count) <= 0)
return new (_internal.EmptyIterable$(E))();
return new (exports._GeneratorIterable$(E))(count, generator);
}
[dart.JsSymbol.iterator]() {
return new dart.JsIterator(this[dartx.iterator]);
return new (_GeneratorIterable$(E))(count, generator);
}
[dartx.join](separator) {
if (separator === void 0)
Expand All @@ -1282,6 +1279,9 @@ dart_library.library('dart/core', null, /* Imports */[
buffer.writeAll(this, separator);
return dart.toString(buffer);
}
[dart.JsSymbol.iterator]() {
return new dart.JsIterator(this[dartx.iterator]);
}
}
dart.setSignature(Iterable, {
constructors: () => ({
Expand All @@ -1306,7 +1306,7 @@ dart_library.library('dart/core', null, /* Imports */[
_GeneratorIterable(end, generator) {
this[_end] = end;
this[_start] = 0;
this[_generator] = dart.as(generator != null ? generator : exports._GeneratorIterable$()._id, _Generator$(E));
this[_generator] = dart.as(generator != null ? generator : _GeneratorIterable$()._id, _Generator$(E));
super.IterableBase();
}
slice(start, end, generator) {
Expand All @@ -1328,7 +1328,7 @@ dart_library.library('dart/core', null, /* Imports */[
let newStart = dart.notNull(this[_start]) + dart.notNull(count);
if (dart.notNull(newStart) >= dart.notNull(this[_end]))
return new (_internal.EmptyIterable$(E))();
return new (exports._GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]);
return new (_GeneratorIterable$(E)).slice(newStart, this[_end], this[_generator]);
}
take(count) {
RangeError.checkNotNegative(count, "count");
Expand All @@ -1337,7 +1337,7 @@ dart_library.library('dart/core', null, /* Imports */[
let newEnd = dart.notNull(this[_start]) + dart.notNull(count);
if (dart.notNull(newEnd) >= dart.notNull(this[_end]))
return this;
return new (exports._GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]);
return new (_GeneratorIterable$(E)).slice(this[_start], newEnd, this[_generator]);
}
static _id(n) {
return n;
Expand All @@ -1347,8 +1347,8 @@ dart_library.library('dart/core', null, /* Imports */[
dart.defineNamedConstructor(_GeneratorIterable, 'slice');
dart.setSignature(_GeneratorIterable, {
constructors: () => ({
_GeneratorIterable: [exports._GeneratorIterable$(E), [int, dart.functionType(E, [int])]],
slice: [exports._GeneratorIterable$(E), [int, int, _Generator$(E)]]
_GeneratorIterable: [_GeneratorIterable$(E), [int, dart.functionType(E, [int])]],
slice: [_GeneratorIterable$(E), [int, int, _Generator$(E)]]
}),
methods: () => ({
skip: [Iterable$(E), [int]],
Expand Down Expand Up @@ -1548,9 +1548,9 @@ dart_library.library('dart/core', null, /* Imports */[
Set[dart.implements] = () => [_internal.EfficientLength];
dart.setSignature(Set, {
constructors: () => ({
new: [exports.Set$(E), []],
identity: [exports.Set$(E), []],
from: [exports.Set$(E), [Iterable]]
new: [Set$(E), []],
identity: [Set$(E), []],
from: [Set$(E), [Iterable]]
})
});
return Set;
Expand Down Expand Up @@ -1729,7 +1729,7 @@ dart_library.library('dart/core', null, /* Imports */[
}
}
dart.setSignature(Runes, {
constructors: () => ({Runes: [exports.Runes, [String]]})
constructors: () => ({Runes: [Runes, [String]]})
});
dart.defineExtensionMembers(Runes, ['iterator', 'last']);
return Runes;
Expand Down
Loading

0 comments on commit 2d5525f

Please sign in to comment.