Index: pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
index 2312c34571088e876960f4d395fa752e4ac4c745..09a7b16ff5cd351df7416455cd531a7661a3c007 100644 |
--- a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
+++ b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
@@ -798,43 +798,48 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
} |
return flatten; |
}; |
- dart.generic = function(typeConstructor) { |
- let length = typeConstructor.length; |
- if (length < 1) { |
- dart.throwInternalError('must have at least one generic type argument'); |
- } |
- let resultMap = new Map(); |
- function makeGenericType(...args) { |
- if (args.length != length && args.length != 0) { |
- dart.throwInternalError('requires ' + length + ' or 0 type arguments'); |
- } |
- while (args.length < length) |
- args.push(dart.dynamic); |
- let value = resultMap; |
- for (let i = 0; i < length; i++) { |
- let arg = args[i]; |
- if (arg == null) { |
- dart.throwInternalError('type arguments should not be null: ' + typeConstructor); |
- } |
- let map = value; |
- value = map.get(arg); |
- if (value === void 0) { |
- if (i + 1 == length) { |
- value = typeConstructor.apply(null, args); |
- if (value) { |
- value[dart._typeArguments] = args; |
- value[dart._originalDeclaration] = makeGenericType; |
+ dart.generic = function(typeConstructor, setBaseClass) { |
+ if (setBaseClass === void 0) setBaseClass = null; |
+ return (() => { |
+ let length = typeConstructor.length; |
+ if (length < 1) { |
+ dart.throwInternalError('must have at least one generic type argument'); |
+ } |
+ let resultMap = new Map(); |
+ function makeGenericType(...args) { |
+ if (args.length != length && args.length != 0) { |
+ dart.throwInternalError('requires ' + length + ' or 0 type arguments'); |
+ } |
+ while (args.length < length) |
+ args.push(dart.dynamic); |
+ let value = resultMap; |
+ for (let i = 0; i < length; i++) { |
+ let arg = args[i]; |
+ if (arg == null) { |
+ dart.throwInternalError('type arguments should not be null: ' + typeConstructor); |
+ } |
+ let map = value; |
+ value = map.get(arg); |
+ if (value === void 0) { |
+ if (i + 1 == length) { |
+ value = typeConstructor.apply(null, args); |
+ if (value) { |
+ value[dart._typeArguments] = args; |
+ value[dart._originalDeclaration] = makeGenericType; |
+ } |
+ map.set(arg, value); |
+ if (setBaseClass) setBaseClass(value); |
+ } else { |
+ value = new Map(); |
+ map.set(arg, value); |
} |
- } else { |
- value = new Map(); |
} |
- map.set(arg, value); |
} |
+ return value; |
} |
- return value; |
- } |
- makeGenericType[dart._genericTypeCtor] = typeConstructor; |
- return makeGenericType; |
+ makeGenericType[dart._genericTypeCtor] = typeConstructor; |
+ return makeGenericType; |
+ })(); |
}; |
dart.getGenericClass = function(type) { |
return dart.safeGetOwnProperty(type, dart._originalDeclaration); |
@@ -26761,7 +26766,6 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
return this[_nextLink]; |
} |
} |
- dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry)); |
_UserDoubleLinkedQueueEntry[dart.implements] = () => [DoubleLinkedQueueEntryOfE()]; |
dart.setSignature(_UserDoubleLinkedQueueEntry, { |
constructors: () => ({new: dart.definiteFunctionType(collection._UserDoubleLinkedQueueEntry$(E), [E])}), |
@@ -26775,6 +26779,8 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
}) |
}); |
return _UserDoubleLinkedQueueEntry; |
+ }, _UserDoubleLinkedQueueEntry => { |
+ dart.setBaseClass(_UserDoubleLinkedQueueEntry, collection._DoubleLink$(_UserDoubleLinkedQueueEntry)); |
}); |
collection._UserDoubleLinkedQueueEntry = _UserDoubleLinkedQueueEntry(); |
const _queue = Symbol('_queue'); |
@@ -26804,7 +26810,6 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
return this[_previousLink][_asNonSentinelEntry](); |
} |
} |
- dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry)); |
dart.setSignature(_DoubleLinkedQueueEntry, { |
constructors: () => ({new: dart.definiteFunctionType(collection._DoubleLinkedQueueEntry$(E), [DoubleLinkedQueueOfE()])}), |
fields: () => ({[_queue]: DoubleLinkedQueueOfE()}), |
@@ -26816,6 +26821,8 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
}) |
}); |
return _DoubleLinkedQueueEntry; |
+ }, _DoubleLinkedQueueEntry => { |
+ dart.setBaseClass(_DoubleLinkedQueueEntry, collection._DoubleLink$(_DoubleLinkedQueueEntry)); |
}); |
collection._DoubleLinkedQueueEntry = _DoubleLinkedQueueEntry(); |
const _elementCount = Symbol('_elementCount'); |