ember-source 4.5.0-beta.1 → 4.6.0-alpha.3
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/blueprints-js/-addon-import.js +48 -0
- package/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js +24 -0
- package/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +12 -0
- package/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/component/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component/files/__root__/__templatepath__/__templatename__.hbs +1 -0
- package/blueprints-js/component-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-class/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component-class-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +34 -0
- package/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +38 -0
- package/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +31 -0
- package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/controller/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/helper/files/__root__/__collection__/__name__.js +5 -0
- package/blueprints-js/helper/mu-files/__root__/__collection__/__name__.js +7 -0
- package/blueprints-js/helper-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +26 -0
- package/blueprints-js/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +28 -0
- package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +18 -0
- package/blueprints-js/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +15 -0
- package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +17 -0
- package/blueprints-js/initializer/files/__root__/initializers/__name__.js +5 -0
- package/blueprints-js/initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +28 -0
- package/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +31 -0
- package/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +25 -0
- package/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +37 -0
- package/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js +5 -0
- package/blueprints-js/instance-initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +30 -0
- package/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +32 -0
- package/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +26 -0
- package/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +39 -0
- package/blueprints-js/mixin/files/__root__/mixins/__name__.js +3 -0
- package/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/route/files/__root__/__path__/__name__.js +9 -0
- package/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs +2 -0
- package/blueprints-js/route-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js +1 -0
- package/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +15 -0
- package/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js +17 -0
- package/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/service/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/template/files/__root__/__path__/__name__.hbs +0 -0
- package/blueprints-js/test-framework-detector.js +60 -0
- package/blueprints-js/util/files/__root__/utils/__name__.js +3 -0
- package/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js +10 -0
- package/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +10 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +4 -4
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +112 -136
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +584 -944
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/error-handling/index.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +21 -11
- package/dist/packages/@ember/-internals/metal/index.js +16 -9
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +0 -4
- package/dist/packages/@ember/-internals/runtime/lib/compare.js +4 -3
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +281 -368
- package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -5
- package/dist/packages/@ember/application/lib/application.js +4 -1
- package/dist/packages/@ember/canary-features/index.js +2 -2
- package/dist/packages/@ember/controller/lib/controller_mixin.js +8 -18
- package/dist/packages/@ember/engine/index.js +3 -1
- package/dist/packages/@ember/object/index.js +16 -8
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +6 -4
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +74 -365
- package/dist/packages/@ember/test/adapter.js +2 -2
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/lib/adapters/adapter.js +11 -27
- package/dist/packages/ember-testing/lib/adapters/qunit.js +8 -16
- package/dist/packages/ember-testing/lib/ext/application.js +28 -19
- package/dist/packages/ember-testing/lib/helpers/and_then.js +4 -1
- package/dist/packages/ember-testing/lib/helpers/current_path.js +5 -0
- package/dist/packages/ember-testing/lib/helpers/current_route_name.js +5 -0
- package/dist/packages/ember-testing/lib/helpers/current_url.js +8 -1
- package/dist/packages/ember-testing/lib/helpers/visit.js +12 -2
- package/dist/packages/ember-testing/lib/helpers/wait.js +6 -1
- package/dist/packages/ember-testing/lib/initializers.js +3 -3
- package/dist/packages/ember-testing/lib/test/adapter.js +2 -1
- package/dist/packages/ember-testing/lib/test/helpers.js +3 -1
- package/dist/packages/ember-testing/lib/test/on_inject_helpers.js +2 -2
- package/dist/packages/ember-testing/lib/test/promise.js +8 -8
- package/dist/packages/ember-testing/lib/test/waiters.js +14 -45
- package/dist/packages/ember-testing/lib/test.js +1 -1
- package/docs/data.json +745 -729
- package/package.json +7 -6
package/dist/header/license.js
CHANGED
|
@@ -13,7 +13,7 @@ export function getOnerror() {
|
|
|
13
13
|
export function setOnerror(handler) {
|
|
14
14
|
onerror = handler;
|
|
15
15
|
}
|
|
16
|
-
let dispatchOverride; // allows testing adapter to override dispatch
|
|
16
|
+
let dispatchOverride = null; // allows testing adapter to override dispatch
|
|
17
17
|
|
|
18
18
|
export function getDispatchOverride() {
|
|
19
19
|
return dispatchOverride;
|
|
@@ -2957,14 +2957,25 @@ function escapeExpression(string) {
|
|
|
2957
2957
|
return string.replace(badChars, escapeChar);
|
|
2958
2958
|
}
|
|
2959
2959
|
/**
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2960
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
2961
|
+
when the string is used in a template. To say this another way,
|
|
2962
|
+
strings marked with `htmlSafe` will not be HTML escaped.
|
|
2963
|
+
|
|
2964
|
+
A word of warning - The `htmlSafe` method does not make the string safe;
|
|
2965
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
2966
|
+
as HTML. If a string contains user inputs or other untrusted
|
|
2967
|
+
data, you must sanitize the string before using the `htmlSafe` method.
|
|
2968
|
+
Otherwise your code is vulnerable to
|
|
2969
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
2970
|
+
There are many open source sanitization libraries to choose from,
|
|
2971
|
+
both for front end and server-side sanitization.
|
|
2963
2972
|
|
|
2964
2973
|
```javascript
|
|
2965
2974
|
import { htmlSafe } from '@ember/template';
|
|
2966
2975
|
|
|
2967
|
-
|
|
2976
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
2977
|
+
|
|
2978
|
+
htmlSafe(someTrustedorSanitizedString)
|
|
2968
2979
|
```
|
|
2969
2980
|
|
|
2970
2981
|
@method htmlSafe
|
|
@@ -5166,10 +5177,13 @@ class DynamicScope {
|
|
|
5166
5177
|
return value;
|
|
5167
5178
|
}
|
|
5168
5179
|
|
|
5169
|
-
}
|
|
5180
|
+
}
|
|
5181
|
+
|
|
5182
|
+
const NO_OP = () => {}; // This wrapper logic prevents us from rerendering in case of a hard failure
|
|
5170
5183
|
// during render. This prevents infinite revalidation type loops from occuring,
|
|
5171
5184
|
// and ensures that errors are not swallowed by subsequent follow on failures.
|
|
5172
5185
|
|
|
5186
|
+
|
|
5173
5187
|
function errorLoopTransaction(fn$$1) {
|
|
5174
5188
|
if (DEBUG) {
|
|
5175
5189
|
return () => {
|
|
@@ -5270,10 +5284,6 @@ function loopBegin() {
|
|
|
5270
5284
|
}
|
|
5271
5285
|
}
|
|
5272
5286
|
|
|
5273
|
-
function K() {
|
|
5274
|
-
/* noop */
|
|
5275
|
-
}
|
|
5276
|
-
|
|
5277
5287
|
let renderSettledDeferred = null;
|
|
5278
5288
|
/*
|
|
5279
5289
|
Returns a promise which will resolve when rendering has settled. Settled in
|
|
@@ -5292,7 +5302,7 @@ function renderSettled() {
|
|
|
5292
5302
|
|
|
5293
5303
|
if (!_getCurrentRunLoop()) {
|
|
5294
5304
|
// ensure a runloop has been kicked off
|
|
5295
|
-
_backburner.schedule('actions', null,
|
|
5305
|
+
_backburner.schedule('actions', null, NO_OP);
|
|
5296
5306
|
}
|
|
5297
5307
|
}
|
|
5298
5308
|
|
|
@@ -5321,7 +5331,7 @@ function loopEnd() {
|
|
|
5321
5331
|
}
|
|
5322
5332
|
|
|
5323
5333
|
loops++;
|
|
5324
|
-
return _backburner.join(null,
|
|
5334
|
+
return _backburner.join(null, NO_OP);
|
|
5325
5335
|
}
|
|
5326
5336
|
}
|
|
5327
5337
|
|
|
@@ -14,9 +14,6 @@ import VERSION from 'ember/version';
|
|
|
14
14
|
import { INIT_FACTORY } from '@ember/-internals/container';
|
|
15
15
|
import { getOwner } from '@ember/-internals/owner';
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
@module @ember/object
|
|
19
|
-
*/
|
|
20
17
|
/*
|
|
21
18
|
The event system uses a series of nested hashes to store listeners on an
|
|
22
19
|
object. When a listener is registered, or when an event arrives, these
|
|
@@ -628,12 +625,19 @@ function objectAt(array, index) {
|
|
|
628
625
|
} else {
|
|
629
626
|
return array.objectAt(index);
|
|
630
627
|
}
|
|
628
|
+
} // Ideally, we'd use MutableArray.detect but for unknown reasons this causes
|
|
629
|
+
// the node tests to fail strangely.
|
|
630
|
+
|
|
631
|
+
function isMutableArray(obj) {
|
|
632
|
+
return obj != null && typeof obj.replace === 'function';
|
|
631
633
|
}
|
|
634
|
+
|
|
632
635
|
function replace(array, start, deleteCount, items = EMPTY_ARRAY) {
|
|
633
|
-
if (
|
|
634
|
-
replaceInNativeArray(array, start, deleteCount, items);
|
|
635
|
-
} else {
|
|
636
|
+
if (isMutableArray(array)) {
|
|
636
637
|
array.replace(start, deleteCount, items);
|
|
638
|
+
} else {
|
|
639
|
+
assert('Can only replace content of a native array or MutableArray', Array.isArray(array));
|
|
640
|
+
replaceInNativeArray(array, start, deleteCount, items);
|
|
637
641
|
}
|
|
638
642
|
}
|
|
639
643
|
const CHUNK_SIZE = 60000; // To avoid overflowing the stack, we splice up to CHUNK_SIZE items at a time.
|
|
@@ -3149,7 +3153,10 @@ class Mixin {
|
|
|
3149
3153
|
|
|
3150
3154
|
|
|
3151
3155
|
keys() {
|
|
3152
|
-
|
|
3156
|
+
let keys = _keys(this);
|
|
3157
|
+
|
|
3158
|
+
assert('[BUG] Missing keys for mixin!', keys);
|
|
3159
|
+
return keys;
|
|
3153
3160
|
}
|
|
3154
3161
|
/** @internal */
|
|
3155
3162
|
|
|
@@ -3225,8 +3232,8 @@ function _keys(mixin, ret = new Set(), seen = new Set()) {
|
|
|
3225
3232
|
if (mixin.properties) {
|
|
3226
3233
|
let props = Object.keys(mixin.properties);
|
|
3227
3234
|
|
|
3228
|
-
for (let
|
|
3229
|
-
ret.add(
|
|
3235
|
+
for (let prop of props) {
|
|
3236
|
+
ret.add(prop);
|
|
3230
3237
|
}
|
|
3231
3238
|
} else if (mixin.mixins) {
|
|
3232
3239
|
mixin.mixins.forEach(x => _keys(x, ret, seen));
|
|
@@ -12,10 +12,6 @@ import { calculateCacheKey, extractRouteArgs, getActiveTargetName, resemblesURL
|
|
|
12
12
|
import DSL from './dsl';
|
|
13
13
|
import { defaultSerialize, getFullQueryParams, hasDefaultSerialize, ROUTE_CONNECTIONS } from './route';
|
|
14
14
|
import RouterState from './router_state';
|
|
15
|
-
/**
|
|
16
|
-
@module @ember/routing
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
15
|
import Router, { logAbort, STATE_SYMBOL } from 'router_js';
|
|
20
16
|
import EngineInstance from '@ember/engine/instance';
|
|
21
17
|
|
|
@@ -35,9 +35,10 @@ const TYPE_ORDER = {
|
|
|
35
35
|
// SSt `------'`
|
|
36
36
|
|
|
37
37
|
function spaceship(a, b) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
// SAFETY: `Math.sign` always returns `-1` for negative, `0` for zero, and `1`
|
|
39
|
+
// for positive numbers. (The extra precision is useful for the way we use
|
|
40
|
+
// this in the context of `compare`.)
|
|
41
|
+
return Math.sign(a - b);
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
@module @ember/utils
|