dist/ember.prod.js in ember-source-2.17.0.beta.5 vs dist/ember.prod.js in ember-source-2.17.0.beta.6
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 2.17.0-beta.5
+ * @version 2.17.0-beta.6
*/
var enifed, requireModule, Ember;
var mainContext = this; // Used in ember-environment/lib/global.js
@@ -17307,21 +17307,22 @@
}
var helperFactory = owner.factoryFor('helper:' + name, moduleName && { source: 'template:' + moduleName } || {}) || owner.factoryFor('helper:' + name);
// TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations
- if (helperFactory.class.isHelperInstance) {
- return function (vm, args) {
- return _references.SimpleHelperReference.create(helperFactory.class.compute, args.capture());
- };
+ var HelperReference = void 0;
+ if (helperFactory.class.isSimpleHelperFactory) {
+ HelperReference = _references.SimpleHelperReference;
} else if (helperFactory.class.isHelperFactory) {
- return function (vm, args) {
- return _references.ClassBasedHelperReference.create(helperFactory, vm, args.capture());
- };
+ HelperReference = _references.ClassBasedHelperReference;
} else {
throw new Error(name + ' is not a helper');
}
+
+ return function (vm, args) {
+ return HelperReference.create(helperFactory, vm, args.capture());
+ };
};
Environment.prototype.hasModifier = function (name) {
return !!this.builtInModifiers[name];
};
@@ -17394,11 +17395,11 @@
exports.default = Environment;
});
enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberRuntime, _reference) {
'use strict';
- exports.RECOMPUTE_TAG = undefined;
+ exports.SimpleHelper = exports.RECOMPUTE_TAG = undefined;
exports.helper =
/**
In many cases, the ceremony of a full `Helper` class is not required.
The `helper` method create pure-function helpers without instances. For
@@ -17420,14 +17421,11 @@
@for @ember/component/helper
@public
@since 1.13.0
*/
function (helperFn) {
- return {
- isHelperInstance: true,
- compute: helperFn
- };
+ return new SimpleHelper(helperFn);
};
var RECOMPUTE_TAG = exports.RECOMPUTE_TAG = (0, _emberUtils.symbol)('RECOMPUTE_TAG');
/**
Ember Helpers are functions that can compute values, and are used in templates.
@@ -17498,10 +17496,26 @@
Helper.reopenClass({
isHelperFactory: true
});
+ var SimpleHelper = exports.SimpleHelper = function () {
+ function SimpleHelper(compute) {
+
+ this.isHelperFactory = true;
+ this.isHelperInstance = true;
+ this.isSimpleHelperFactory = true;
+ this.compute = compute;
+ }
+
+ SimpleHelper.prototype.create = function () {
+ return this;
+ };
+
+ return SimpleHelper;
+ }();
+
exports.default = Helper;
});
enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _references, _emberRuntime) {
'use strict';
@@ -21475,27 +21489,32 @@
}(_runtime.ConditionalReference);
exports.SimpleHelperReference = function (_CachedReference2) {
(0, _emberBabel.inherits)(SimpleHelperReference, _CachedReference2);
- SimpleHelperReference.create = function (helper, args) {
- var positional, named, positionalValue, namedValue, result;
+ SimpleHelperReference.create = function (Helper, _vm, args) {
+ var helper = Helper.create(),
+ positional,
+ named,
+ positionalValue,
+ namedValue,
+ result;
if ((0, _reference.isConst)(args)) {
positional = args.positional, named = args.named;
positionalValue = positional.value();
namedValue = named.value();
- result = helper(positionalValue, namedValue);
+ result = helper.compute(positionalValue, namedValue);
if (typeof result === 'object' && result !== null || typeof result === 'function') {
return new RootReference(result);
} else {
return _runtime.PrimitiveReference.create(result);
}
} else {
- return new SimpleHelperReference(helper, args);
+ return new SimpleHelperReference(helper.compute, args);
}
};
function SimpleHelperReference(helper, args) {
@@ -23488,12 +23507,15 @@
ChainNode.prototype.remove = function (path) {
var paths = this._paths;
if (paths === undefined) {
return;
}
+
if (paths[path] > 0) {
paths[path]--;
+ } else {
+ return;
}
var key = firstKey(path);
var tail = path.slice(key.length + 1);
@@ -40769,42 +40791,46 @@
ignore.push(methodName);
}
});
exports.NativeArray = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore);
-
/**
- Creates an `Ember.NativeArray` from an Array like object.
- Does not modify the original object's contents. Ember.A is not needed if
+ @module @ember/array
+ */
+ /**
+ Creates an `Ember.NativeArray` from an Array-like object.
+ Does not modify the original object's contents. `A()` is not needed if
`EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,
- it is recommended that you use Ember.A when creating addons for
+ it is recommended that you use `A()` when creating addons for
ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`
will be `true`.
Example
```app/components/my-component.js
import Component from '@ember/component';
+ import { A } from '@ember/array';
export default Component.extend({
tagName: 'ul',
classNames: ['pagination'],
init() {
this._super(...arguments);
if (!this.get('content')) {
- this.set('content', Ember.A());
+ this.set('content', A());
+ this.set('otherContent', A([1,2,3]));
}
}
});
```
@method A
@static
@for @ember/array
- @return {EmberArray}
+ @return {Ember.NativeArray}
@public
*/
var A = void 0;
if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) {
@@ -44480,10 +44506,10 @@
*/
});
enifed("ember/version", ["exports"], function (exports) {
"use strict";
- exports.default = "2.17.0-beta.5";
+ exports.default = "2.17.0-beta.6";
});
enifed('node-module', ['exports'], function(_exports) {
var IS_NODE = typeof module === 'object' && typeof module.require === 'function';
if (IS_NODE) {
_exports.require = module.require;