ember-source 5.6.0-alpha.2 → 5.6.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-metadata.json +3 -3
- package/dist/dependencies/@glimmer/debug.js +1533 -0
- package/dist/dependencies/@glimmer/destroyable.js +30 -59
- package/dist/dependencies/@glimmer/encoder.js +13 -24
- package/dist/dependencies/@glimmer/global-context.js +38 -41
- package/dist/dependencies/@glimmer/manager.js +144 -326
- package/dist/dependencies/@glimmer/node.js +14 -46
- package/dist/dependencies/@glimmer/opcode-compiler.js +1673 -2478
- package/dist/dependencies/@glimmer/owner.js +2 -5
- package/dist/dependencies/@glimmer/program.js +102 -185
- package/dist/dependencies/@glimmer/reference.js +58 -126
- package/dist/dependencies/@glimmer/runtime.js +4674 -5639
- package/dist/dependencies/@glimmer/util.js +340 -326
- package/dist/dependencies/@glimmer/validator.js +160 -217
- package/dist/dependencies/@glimmer/vm.js +174 -23
- package/dist/dependencies/@glimmer/wire-format.js +91 -34
- package/dist/dependencies/@simple-dom/document.js +1 -1
- package/dist/dependencies/backburner.js.js +1 -1
- package/dist/dependencies/router_js.js +15 -16
- package/dist/dependencies/rsvp.js +89 -88
- package/dist/ember-template-compiler.js +8574 -8350
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +107 -107
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +11216 -9634
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +109 -80
- package/dist/packages/@ember/-internals/metal/index.js +5 -4
- package/dist/packages/@ember/-internals/utils/index.js +3 -4
- package/dist/packages/@ember/array/-internals.js +1 -2
- package/dist/packages/@ember/debug/lib/inspect.js +0 -1
- package/dist/packages/@ember/object/core.js +0 -1
- package/dist/packages/@ember/object/mixin.js +1 -2
- package/dist/packages/@ember/routing/route.js +23 -101
- package/dist/packages/@ember/routing/router.js +25 -84
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-babel.js +13 -0
- package/docs/data.json +217 -242
- package/lib/index.js +1 -5
- package/package.json +26 -21
- package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +4 -4
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +5 -8
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/root.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/resolver.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/syntax/utils.d.ts +3 -2
- package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +2 -2
- package/types/stable/@ember/-internals/glimmer/lib/utils/outlet.d.ts +39 -18
- package/types/stable/@ember/-internals/utility-types/index.d.ts +1 -0
- package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +4 -3
- package/types/stable/@ember/routing/route.d.ts +6 -28
- package/dist/dependencies/@glimmer/low-level.js +0 -77
|
@@ -1,4 +1,150 @@
|
|
|
1
|
-
|
|
1
|
+
const ContentType = {
|
|
2
|
+
Component: 0,
|
|
3
|
+
Helper: 1,
|
|
4
|
+
String: 2,
|
|
5
|
+
Empty: 3,
|
|
6
|
+
SafeString: 4,
|
|
7
|
+
Fragment: 5,
|
|
8
|
+
Node: 6,
|
|
9
|
+
Other: 8
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const CurriedTypes = {
|
|
13
|
+
Component: 0,
|
|
14
|
+
Helper: 1,
|
|
15
|
+
Modifier: 2
|
|
16
|
+
};
|
|
17
|
+
const InternalComponentCapabilities = {
|
|
18
|
+
Empty: 0,
|
|
19
|
+
dynamicLayout: 0b0000000000001,
|
|
20
|
+
dynamicTag: 0b0000000000010,
|
|
21
|
+
prepareArgs: 0b0000000000100,
|
|
22
|
+
createArgs: 0b0000000001000,
|
|
23
|
+
attributeHook: 0b0000000010000,
|
|
24
|
+
elementHook: 0b0000000100000,
|
|
25
|
+
dynamicScope: 0b0000001000000,
|
|
26
|
+
createCaller: 0b0000010000000,
|
|
27
|
+
updateHook: 0b0000100000000,
|
|
28
|
+
createInstance: 0b0001000000000,
|
|
29
|
+
wrapped: 0b0010000000000,
|
|
30
|
+
willDestroy: 0b0100000000000,
|
|
31
|
+
hasSubOwner: 0b1000000000000
|
|
32
|
+
};
|
|
33
|
+
const ARG_SHIFT = 8;
|
|
34
|
+
const MAX_SIZE = 0x7fffffff;
|
|
35
|
+
const TYPE_SIZE = 0b11111111;
|
|
36
|
+
const TYPE_MASK = 0b00000000000000000000000011111111;
|
|
37
|
+
const OPERAND_LEN_MASK = 0b00000000000000000000001100000000;
|
|
38
|
+
const MACHINE_MASK = 0b00000000000000000000010000000000;
|
|
39
|
+
|
|
40
|
+
const MachineOp = {
|
|
41
|
+
PushFrame: 0,
|
|
42
|
+
PopFrame: 1,
|
|
43
|
+
InvokeVirtual: 2,
|
|
44
|
+
InvokeStatic: 3,
|
|
45
|
+
Jump: 4,
|
|
46
|
+
Return: 5,
|
|
47
|
+
ReturnTo: 6,
|
|
48
|
+
Size: 7
|
|
49
|
+
};
|
|
50
|
+
const Op = {
|
|
51
|
+
Helper: 16,
|
|
52
|
+
SetNamedVariables: 17,
|
|
53
|
+
SetBlocks: 18,
|
|
54
|
+
SetVariable: 19,
|
|
55
|
+
SetBlock: 20,
|
|
56
|
+
GetVariable: 21,
|
|
57
|
+
GetProperty: 22,
|
|
58
|
+
GetBlock: 23,
|
|
59
|
+
SpreadBlock: 24,
|
|
60
|
+
HasBlock: 25,
|
|
61
|
+
HasBlockParams: 26,
|
|
62
|
+
Concat: 27,
|
|
63
|
+
Constant: 28,
|
|
64
|
+
ConstantReference: 29,
|
|
65
|
+
Primitive: 30,
|
|
66
|
+
PrimitiveReference: 31,
|
|
67
|
+
ReifyU32: 32,
|
|
68
|
+
Dup: 33,
|
|
69
|
+
Pop: 34,
|
|
70
|
+
Load: 35,
|
|
71
|
+
Fetch: 36,
|
|
72
|
+
RootScope: 37,
|
|
73
|
+
VirtualRootScope: 38,
|
|
74
|
+
ChildScope: 39,
|
|
75
|
+
PopScope: 40,
|
|
76
|
+
Text: 41,
|
|
77
|
+
Comment: 42,
|
|
78
|
+
AppendHTML: 43,
|
|
79
|
+
AppendSafeHTML: 44,
|
|
80
|
+
AppendDocumentFragment: 45,
|
|
81
|
+
AppendNode: 46,
|
|
82
|
+
AppendText: 47,
|
|
83
|
+
OpenElement: 48,
|
|
84
|
+
OpenDynamicElement: 49,
|
|
85
|
+
PushRemoteElement: 50,
|
|
86
|
+
StaticAttr: 51,
|
|
87
|
+
DynamicAttr: 52,
|
|
88
|
+
ComponentAttr: 53,
|
|
89
|
+
FlushElement: 54,
|
|
90
|
+
CloseElement: 55,
|
|
91
|
+
PopRemoteElement: 56,
|
|
92
|
+
Modifier: 57,
|
|
93
|
+
BindDynamicScope: 58,
|
|
94
|
+
PushDynamicScope: 59,
|
|
95
|
+
PopDynamicScope: 60,
|
|
96
|
+
CompileBlock: 61,
|
|
97
|
+
PushBlockScope: 62,
|
|
98
|
+
PushSymbolTable: 63,
|
|
99
|
+
InvokeYield: 64,
|
|
100
|
+
JumpIf: 65,
|
|
101
|
+
JumpUnless: 66,
|
|
102
|
+
JumpEq: 67,
|
|
103
|
+
AssertSame: 68,
|
|
104
|
+
Enter: 69,
|
|
105
|
+
Exit: 70,
|
|
106
|
+
ToBoolean: 71,
|
|
107
|
+
EnterList: 72,
|
|
108
|
+
ExitList: 73,
|
|
109
|
+
Iterate: 74,
|
|
110
|
+
Main: 75,
|
|
111
|
+
ContentType: 76,
|
|
112
|
+
Curry: 77,
|
|
113
|
+
PushComponentDefinition: 78,
|
|
114
|
+
PushDynamicComponentInstance: 79,
|
|
115
|
+
ResolveDynamicComponent: 80,
|
|
116
|
+
ResolveCurriedComponent: 81,
|
|
117
|
+
PushArgs: 82,
|
|
118
|
+
PushEmptyArgs: 83,
|
|
119
|
+
PopArgs: 84,
|
|
120
|
+
PrepareArgs: 85,
|
|
121
|
+
CaptureArgs: 86,
|
|
122
|
+
CreateComponent: 87,
|
|
123
|
+
RegisterComponentDestructor: 88,
|
|
124
|
+
PutComponentOperations: 89,
|
|
125
|
+
GetComponentSelf: 90,
|
|
126
|
+
GetComponentTagName: 91,
|
|
127
|
+
GetComponentLayout: 92,
|
|
128
|
+
BindEvalScope: 93,
|
|
129
|
+
SetupForEval: 94,
|
|
130
|
+
PopulateLayout: 95,
|
|
131
|
+
InvokeComponentLayout: 96,
|
|
132
|
+
BeginComponentTransaction: 97,
|
|
133
|
+
CommitComponentTransaction: 98,
|
|
134
|
+
DidCreateElement: 99,
|
|
135
|
+
DidRenderLayout: 100,
|
|
136
|
+
ResolveMaybeLocal: 102,
|
|
137
|
+
Debugger: 103,
|
|
138
|
+
Size: 104,
|
|
139
|
+
StaticComponentAttr: 105,
|
|
140
|
+
DynamicContentType: 106,
|
|
141
|
+
DynamicHelper: 107,
|
|
142
|
+
DynamicModifier: 108,
|
|
143
|
+
IfInline: 109,
|
|
144
|
+
Not: 110,
|
|
145
|
+
GetDynamicVar: 111,
|
|
146
|
+
Log: 112
|
|
147
|
+
};
|
|
2
148
|
function isMachineOp(value) {
|
|
3
149
|
return value >= 0 && value <= 15;
|
|
4
150
|
}
|
|
@@ -12,37 +158,42 @@ function isOp(value) {
|
|
|
12
158
|
* For the most part, these follows MIPS naming conventions, however the
|
|
13
159
|
* register numbers are different.
|
|
14
160
|
*/
|
|
15
|
-
// $0 or $pc (program counter): pointer into `program` for the next insturction; -1 means exit
|
|
16
|
-
const $pc = 0; // $1 or $ra (return address): pointer into `program` for the return
|
|
17
|
-
|
|
18
|
-
const $ra = 1; // $2 or $fp (frame pointer): pointer into the `evalStack` for the base of the stack
|
|
19
|
-
|
|
20
|
-
const $fp = 2; // $3 or $sp (stack pointer): pointer into the `evalStack` for the top of the stack
|
|
21
|
-
|
|
22
|
-
const $sp = 3; // $4-$5 or $s0-$s1 (saved): callee saved general-purpose registers
|
|
23
161
|
|
|
162
|
+
// $0 or $pc (program counter): pointer into `program` for the next insturction; -1 means exit
|
|
163
|
+
const $pc = 0;
|
|
164
|
+
// $1 or $ra (return address): pointer into `program` for the return
|
|
165
|
+
const $ra = 1;
|
|
166
|
+
// $2 or $fp (frame pointer): pointer into the `evalStack` for the base of the stack
|
|
167
|
+
const $fp = 2;
|
|
168
|
+
// $3 or $sp (stack pointer): pointer into the `evalStack` for the top of the stack
|
|
169
|
+
const $sp = 3;
|
|
170
|
+
// $4-$5 or $s0-$s1 (saved): callee saved general-purpose registers
|
|
24
171
|
const $s0 = 4;
|
|
25
|
-
const $s1 = 5;
|
|
26
|
-
|
|
172
|
+
const $s1 = 5;
|
|
173
|
+
// $6-$7 or $t0-$t1 (temporaries): caller saved general-purpose registers
|
|
27
174
|
const $t0 = 6;
|
|
28
|
-
const $t1 = 7;
|
|
29
|
-
|
|
175
|
+
const $t1 = 7;
|
|
176
|
+
// $8 or $v0 (return value)
|
|
30
177
|
const $v0 = 8;
|
|
178
|
+
let MachineRegister = /*#__PURE__*/function (MachineRegister) {
|
|
179
|
+
MachineRegister[MachineRegister["pc"] = 0] = "pc";
|
|
180
|
+
MachineRegister[MachineRegister["ra"] = 1] = "ra";
|
|
181
|
+
MachineRegister[MachineRegister["fp"] = 2] = "fp";
|
|
182
|
+
MachineRegister[MachineRegister["sp"] = 3] = "sp";
|
|
183
|
+
return MachineRegister;
|
|
184
|
+
}({});
|
|
31
185
|
function isLowLevelRegister(register) {
|
|
32
186
|
return register <= $sp;
|
|
33
187
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(function (SavedRegister) {
|
|
188
|
+
let SavedRegister = /*#__PURE__*/function (SavedRegister) {
|
|
37
189
|
SavedRegister[SavedRegister["s0"] = 4] = "s0";
|
|
38
190
|
SavedRegister[SavedRegister["s1"] = 5] = "s1";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(function (TemporaryRegister) {
|
|
191
|
+
return SavedRegister;
|
|
192
|
+
}({});
|
|
193
|
+
let TemporaryRegister = /*#__PURE__*/function (TemporaryRegister) {
|
|
44
194
|
TemporaryRegister[TemporaryRegister["t0"] = 6] = "t0";
|
|
45
195
|
TemporaryRegister[TemporaryRegister["t1"] = 7] = "t1";
|
|
46
|
-
|
|
196
|
+
return TemporaryRegister;
|
|
197
|
+
}({});
|
|
47
198
|
|
|
48
|
-
export { $fp, $pc, $ra, $s0, $s1, $sp, $t0, $t1, $v0, SavedRegister, TemporaryRegister, isLowLevelRegister, isMachineOp, isOp };
|
|
199
|
+
export { $fp, $pc, $ra, $s0, $s1, $sp, $t0, $t1, $v0, ARG_SHIFT, ContentType, CurriedTypes as CurriedType, CurriedTypes, InternalComponentCapabilities, InternalComponentCapabilities as InternalComponentCapability, MACHINE_MASK, MAX_SIZE, MachineOp, MachineRegister, OPERAND_LEN_MASK, Op, SavedRegister, TYPE_MASK, TYPE_SIZE, TemporaryRegister, isLowLevelRegister, isMachineOp, isOp };
|
|
@@ -1,30 +1,94 @@
|
|
|
1
|
+
const opcodes = {
|
|
2
|
+
Append: 1,
|
|
3
|
+
TrustingAppend: 2,
|
|
4
|
+
Comment: 3,
|
|
5
|
+
Modifier: 4,
|
|
6
|
+
StrictModifier: 5,
|
|
7
|
+
Block: 6,
|
|
8
|
+
StrictBlock: 7,
|
|
9
|
+
Component: 8,
|
|
10
|
+
OpenElement: 10,
|
|
11
|
+
OpenElementWithSplat: 11,
|
|
12
|
+
FlushElement: 12,
|
|
13
|
+
CloseElement: 13,
|
|
14
|
+
StaticAttr: 14,
|
|
15
|
+
DynamicAttr: 15,
|
|
16
|
+
ComponentAttr: 16,
|
|
17
|
+
AttrSplat: 17,
|
|
18
|
+
Yield: 18,
|
|
19
|
+
DynamicArg: 20,
|
|
20
|
+
StaticArg: 21,
|
|
21
|
+
TrustingDynamicAttr: 22,
|
|
22
|
+
TrustingComponentAttr: 23,
|
|
23
|
+
StaticComponentAttr: 24,
|
|
24
|
+
Debugger: 26,
|
|
25
|
+
Undefined: 27,
|
|
26
|
+
Call: 28,
|
|
27
|
+
Concat: 29,
|
|
28
|
+
GetSymbol: 30,
|
|
29
|
+
GetLexicalSymbol: 32,
|
|
30
|
+
GetStrictKeyword: 31,
|
|
31
|
+
GetFreeAsComponentOrHelperHeadOrThisFallback: 34,
|
|
32
|
+
GetFreeAsComponentOrHelperHead: 35,
|
|
33
|
+
GetFreeAsHelperHeadOrThisFallback: 36,
|
|
34
|
+
GetFreeAsDeprecatedHelperHeadOrThisFallback: 99,
|
|
35
|
+
GetFreeAsHelperHead: 37,
|
|
36
|
+
GetFreeAsModifierHead: 38,
|
|
37
|
+
GetFreeAsComponentHead: 39,
|
|
38
|
+
InElement: 40,
|
|
39
|
+
If: 41,
|
|
40
|
+
Each: 42,
|
|
41
|
+
With: 43,
|
|
42
|
+
Let: 44,
|
|
43
|
+
WithDynamicVars: 45,
|
|
44
|
+
InvokeComponent: 46,
|
|
45
|
+
HasBlock: 48,
|
|
46
|
+
HasBlockParams: 49,
|
|
47
|
+
Curry: 50,
|
|
48
|
+
Not: 51,
|
|
49
|
+
IfInline: 52,
|
|
50
|
+
GetDynamicVar: 53,
|
|
51
|
+
Log: 54
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
|
+
|
|
56
|
+
const resolution = {
|
|
57
|
+
Strict: 0,
|
|
58
|
+
AmbiguousAppend: 1,
|
|
59
|
+
AmbiguousAppendInvoke: 2,
|
|
60
|
+
AmbiguousInvoke: 3,
|
|
61
|
+
ResolveAsCallHead: 5,
|
|
62
|
+
ResolveAsModifierHead: 6,
|
|
63
|
+
ResolveAsComponentHead: 7
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const WellKnownAttrNames = {
|
|
67
|
+
class: 0,
|
|
68
|
+
id: 1,
|
|
69
|
+
value: 2,
|
|
70
|
+
name: 3,
|
|
71
|
+
type: 4,
|
|
72
|
+
style: 5,
|
|
73
|
+
href: 6
|
|
74
|
+
};
|
|
75
|
+
const WellKnownTagNames = {
|
|
76
|
+
div: 0,
|
|
77
|
+
span: 1,
|
|
78
|
+
p: 2,
|
|
79
|
+
a: 3
|
|
80
|
+
};
|
|
81
|
+
|
|
1
82
|
function is(variant) {
|
|
2
83
|
return function (value) {
|
|
3
84
|
return Array.isArray(value) && value[0] === variant;
|
|
4
85
|
};
|
|
5
|
-
}
|
|
86
|
+
}
|
|
6
87
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
88
|
+
// Statements
|
|
89
|
+
const isFlushElement = is(opcodes.FlushElement);
|
|
10
90
|
function isAttribute(val) {
|
|
11
|
-
return val[0] ===
|
|
12
|
-
/* StaticAttr */
|
|
13
|
-
|| val[0] === 15
|
|
14
|
-
/* DynamicAttr */
|
|
15
|
-
|| val[0] === 22
|
|
16
|
-
/* TrustingDynamicAttr */
|
|
17
|
-
|| val[0] === 16
|
|
18
|
-
/* ComponentAttr */
|
|
19
|
-
|| val[0] === 24
|
|
20
|
-
/* StaticComponentAttr */
|
|
21
|
-
|| val[0] === 23
|
|
22
|
-
/* TrustingComponentAttr */
|
|
23
|
-
|| val[0] === 17
|
|
24
|
-
/* AttrSplat */
|
|
25
|
-
|| val[0] === 4
|
|
26
|
-
/* Modifier */
|
|
27
|
-
;
|
|
91
|
+
return val[0] === opcodes.StaticAttr || val[0] === opcodes.DynamicAttr || val[0] === opcodes.TrustingDynamicAttr || val[0] === opcodes.ComponentAttr || val[0] === opcodes.StaticComponentAttr || val[0] === opcodes.TrustingComponentAttr || val[0] === opcodes.AttrSplat || val[0] === opcodes.Modifier;
|
|
28
92
|
}
|
|
29
93
|
function isStringLiteral(expr) {
|
|
30
94
|
return typeof expr === 'string';
|
|
@@ -33,20 +97,13 @@ function getStringFromValue(expr) {
|
|
|
33
97
|
return expr;
|
|
34
98
|
}
|
|
35
99
|
function isArgument(val) {
|
|
36
|
-
return val[0] ===
|
|
37
|
-
/* StaticArg */
|
|
38
|
-
|| val[0] === 20
|
|
39
|
-
/* DynamicArg */
|
|
40
|
-
;
|
|
100
|
+
return val[0] === opcodes.StaticArg || val[0] === opcodes.DynamicArg;
|
|
41
101
|
}
|
|
42
102
|
function isHelper(expr) {
|
|
43
|
-
return Array.isArray(expr) && expr[0] ===
|
|
44
|
-
|
|
45
|
-
;
|
|
46
|
-
} // Expressions
|
|
103
|
+
return Array.isArray(expr) && expr[0] === opcodes.Call;
|
|
104
|
+
}
|
|
47
105
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
);
|
|
106
|
+
// Expressions
|
|
107
|
+
const isGet = is(opcodes.GetSymbol);
|
|
51
108
|
|
|
52
|
-
export { getStringFromValue, is, isArgument, isAttribute, isFlushElement, isGet, isHelper, isStringLiteral };
|
|
109
|
+
export { opcodes as SexpOpcodes, resolution as VariableResolutionContext, WellKnownAttrNames, WellKnownTagNames, getStringFromValue, is, isArgument, isAttribute, isFlushElement, isGet, isHelper, isStringLiteral };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import RouteRecognizer from 'route-recognizer';
|
|
2
|
-
import { Promise } from 'rsvp';
|
|
2
|
+
import { Promise as Promise$1 } from 'rsvp';
|
|
3
3
|
import { DEBUG } from '@glimmer/env';
|
|
4
4
|
|
|
5
5
|
function buildTransitionAborted() {
|
|
@@ -218,7 +218,7 @@ class Transition {
|
|
|
218
218
|
this.debugPreviousTransition = previousTransition;
|
|
219
219
|
}
|
|
220
220
|
if (error) {
|
|
221
|
-
this.promise = Promise.reject(error);
|
|
221
|
+
this.promise = Promise$1.reject(error);
|
|
222
222
|
this.error = error;
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
@@ -259,7 +259,7 @@ class Transition {
|
|
|
259
259
|
}, promiseLabel('Handle Abort'));
|
|
260
260
|
}
|
|
261
261
|
else {
|
|
262
|
-
this.promise = Promise.resolve(this[STATE_SYMBOL]);
|
|
262
|
+
this.promise = Promise$1.resolve(this[STATE_SYMBOL]);
|
|
263
263
|
this[PARAMS_SYMBOL] = {};
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -468,7 +468,7 @@ class Transition {
|
|
|
468
468
|
if (router.activeTransition) {
|
|
469
469
|
return router.activeTransition.followRedirects();
|
|
470
470
|
}
|
|
471
|
-
return Promise.reject(reason);
|
|
471
|
+
return Promise$1.reject(reason);
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
474
|
toString() {
|
|
@@ -617,13 +617,13 @@ class InternalRouteInfo {
|
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
getModel(_transition) {
|
|
620
|
-
return Promise.resolve(this.context);
|
|
620
|
+
return Promise$1.resolve(this.context);
|
|
621
621
|
}
|
|
622
622
|
serialize(_context) {
|
|
623
623
|
return this.params || {};
|
|
624
624
|
}
|
|
625
625
|
resolve(transition) {
|
|
626
|
-
return Promise.resolve(this.routePromise)
|
|
626
|
+
return Promise$1.resolve(this.routePromise)
|
|
627
627
|
.then((route) => {
|
|
628
628
|
throwIfAborted(transition);
|
|
629
629
|
return route;
|
|
@@ -717,7 +717,7 @@ class InternalRouteInfo {
|
|
|
717
717
|
if (isTransition(result)) {
|
|
718
718
|
result = null;
|
|
719
719
|
}
|
|
720
|
-
return Promise.resolve(result);
|
|
720
|
+
return Promise$1.resolve(result);
|
|
721
721
|
}
|
|
722
722
|
runAfterModelHook(transition, resolvedModel) {
|
|
723
723
|
// Stash the resolved model on the payload.
|
|
@@ -732,7 +732,7 @@ class InternalRouteInfo {
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
result = prepareResult(result);
|
|
735
|
-
return Promise.resolve(result).then(() => {
|
|
735
|
+
return Promise$1.resolve(result).then(() => {
|
|
736
736
|
// Ignore the fulfilled value returned from afterModel.
|
|
737
737
|
// Return the value stashed in resolvedModels, which
|
|
738
738
|
// might have been swapped out in afterModel.
|
|
@@ -751,7 +751,7 @@ class InternalRouteInfo {
|
|
|
751
751
|
}
|
|
752
752
|
_processRoute(route) {
|
|
753
753
|
// Setup a routePromise so that we can wait for asynchronously loaded routes
|
|
754
|
-
this.routePromise = Promise.resolve(route);
|
|
754
|
+
this.routePromise = Promise$1.resolve(route);
|
|
755
755
|
// Wait until the 'route' property has been updated when chaining to a route
|
|
756
756
|
// that is a promise
|
|
757
757
|
if (isPromise(route)) {
|
|
@@ -779,7 +779,7 @@ class ResolvedRouteInfo extends InternalRouteInfo {
|
|
|
779
779
|
if (transition && transition.resolvedModels) {
|
|
780
780
|
transition.resolvedModels[this.name] = this.context;
|
|
781
781
|
}
|
|
782
|
-
return Promise.resolve(this);
|
|
782
|
+
return Promise$1.resolve(this);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
class UnresolvedRouteInfoByParam extends InternalRouteInfo {
|
|
@@ -809,7 +809,7 @@ class UnresolvedRouteInfoByParam extends InternalRouteInfo {
|
|
|
809
809
|
if (result && isTransition(result)) {
|
|
810
810
|
result = undefined;
|
|
811
811
|
}
|
|
812
|
-
return Promise.resolve(result);
|
|
812
|
+
return Promise$1.resolve(result);
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
class UnresolvedRouteInfoByObject extends InternalRouteInfo {
|
|
@@ -965,7 +965,7 @@ class TransitionState {
|
|
|
965
965
|
let callback = resolveOneRouteInfo.bind(null, this, transition);
|
|
966
966
|
let errorHandler = handleError.bind(null, this, transition);
|
|
967
967
|
// The prelude RSVP.resolve() async moves us into the promise land.
|
|
968
|
-
return Promise.resolve(null, this.promiseLabel('Start transition'))
|
|
968
|
+
return Promise$1.resolve(null, this.promiseLabel('Start transition'))
|
|
969
969
|
.then(callback, null, this.promiseLabel('Resolve route'))
|
|
970
970
|
.catch(errorHandler, this.promiseLabel('Handle error'))
|
|
971
971
|
.then(() => this);
|
|
@@ -1306,7 +1306,7 @@ class Router {
|
|
|
1306
1306
|
let intent = new URLTransitionIntent(this, url);
|
|
1307
1307
|
let newState = this.generateNewState(intent);
|
|
1308
1308
|
if (newState === null) {
|
|
1309
|
-
return Promise.reject(`URL ${url} was not recognized`);
|
|
1309
|
+
return Promise$1.reject(`URL ${url} was not recognized`);
|
|
1310
1310
|
}
|
|
1311
1311
|
let newTransition = new Transition(this, intent, newState, undefined);
|
|
1312
1312
|
return newTransition.then(() => {
|
|
@@ -1427,7 +1427,7 @@ class Router {
|
|
|
1427
1427
|
if (transition.isAborted) {
|
|
1428
1428
|
// TODO: cleaner way? distinguish b/w targetRouteInfos?
|
|
1429
1429
|
this.state.routeInfos = this.currentRouteInfos;
|
|
1430
|
-
return Promise.reject(logAbort(transition));
|
|
1430
|
+
return Promise$1.reject(logAbort(transition));
|
|
1431
1431
|
}
|
|
1432
1432
|
this._updateURL(transition, newState);
|
|
1433
1433
|
transition.isActive = false;
|
|
@@ -1993,5 +1993,4 @@ function paramsEqual(params, otherParams) {
|
|
|
1993
1993
|
return true;
|
|
1994
1994
|
}
|
|
1995
1995
|
|
|
1996
|
-
export default
|
|
1997
|
-
export { InternalRouteInfo, Transition as InternalTransition, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, STATE_SYMBOL, TransitionError, TransitionState, logAbort };
|
|
1996
|
+
export { InternalRouteInfo, Transition as InternalTransition, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, STATE_SYMBOL, TransitionError, TransitionState, Router as default, logAbort };
|