dist/ember-template-compiler.js in ember-source-2.5.0.beta.1 vs dist/ember-template-compiler.js in ember-source-2.5.0.beta.4
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2016 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.5.0-beta.1
+ * @version 2.5.0-beta.4
*/
var enifed, requireModule, require, requirejs, Ember;
var mainContext = this;
@@ -1353,11 +1353,12 @@
*/
/**
Define an assertion that will throw an exception if the condition is not
met. Ember build tools will remove any calls to `Ember.assert()` when
- doing a production build. Example:
+ doing an Ember.js framework production build and will make the assertion a
+ no-op for an application production build. Example:
```javascript
// Test for truthiness
Ember.assert('Must pass a valid object', obj);
@@ -1528,14 +1529,10 @@
if (!_emberMetalCore.default.testing) {
// Complain if they're using FEATURE flags in builds other than canary
_emberMetalFeatures.FEATURES['features-stripped-test'] = true;
var featuresWereStripped = true;
- if (_emberMetalFeatures.default('features-stripped-test')) {
- exports.featuresWereStripped = featuresWereStripped = false;
- }
-
delete _emberMetalFeatures.FEATURES['features-stripped-test'];
_warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, featuresWereStripped);
// Inform the developer about the Ember Inspector if not installed.
var isFirefox = _emberMetalEnvironment.default.isFirefox;
@@ -3262,11 +3259,11 @@
this.firstName = 'Betty';
this.lastName = 'Jones';
},
- fullName: Ember.computed({
+ fullName: Ember.computed('firstName', 'lastName', {
get(key) {
return `${this.get('firstName')} ${this.get('lastName')}`;
},
set(key, value) {
let [firstName, lastName] = value.split(/\s+/);
@@ -4050,11 +4047,11 @@
cross-platform libraries such as jQuery. For more details, see
[Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html).
@class Ember
@static
- @version 2.5.0-beta.1
+ @version 2.5.0-beta.4
@public
*/
if ('undefined' === typeof Ember) {
// Create core object. Make it act like an instance of Ember.Namespace so that
@@ -4092,15 +4089,15 @@
/**
The semantic version.
@property VERSION
@type String
- @default '2.5.0-beta.1'
+ @default '2.5.0-beta.4'
@static
@public
*/
- Ember.VERSION = '2.5.0-beta.1';
+ Ember.VERSION = '2.5.0-beta.4';
/**
The hash of environment variables used to control various configuration
settings. To specify your own or override default settings, add the
desired properties to a global hash named `EmberENV` (or `ENV` for
@@ -5201,14 +5198,10 @@
_emberMetalCore.default.Debug.registerDeprecationHandler = function () {};
_emberMetalCore.default.Debug.registerWarnHandler = function () {};
}
- _emberMetalDebug.deprecate('Support for the `ember-legacy-views` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { id: 'ember-legacy-views', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
-
- _emberMetalDebug.deprecate('Support for the `ember-legacy-controllers` addon will end soon, please remove it from your application.', !!_emberMetalCore.default.ENV._ENABLE_LEGACY_CONTROLLER_SUPPORT, { id: 'ember-legacy-controllers', until: '2.6.0', url: 'http://emberjs.com/deprecations/v1.x/#toc_objectcontroller' });
-
_emberMetalCore.default.create = _emberMetalDebug.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
_emberMetalCore.default.keys = _emberMetalDebug.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys);
exports.default = _emberMetalCore.default;
});
@@ -5735,16 +5728,10 @@
this._registry.splice(index, 1);
}
}
};
- if (_emberMetalFeatures.default('ember-libraries-isregistered')) {
- Libraries.prototype.isRegistered = function (name) {
- return !!this._getLibraryByName(name);
- };
- }
-
exports.default = Libraries;
});
enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) {
'use strict';
@@ -6412,13 +6399,11 @@
@return {Object}
@public
*/
function merge(original, updates) {
- if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
- _emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, { id: 'ember-metal.merge', until: '3.0.0' });
- }
+ _emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, { id: 'ember-metal.merge', until: '3.0.0' });
if (!updates || typeof updates !== 'object') {
return original;
}
@@ -11683,16 +11668,17 @@
EmberHandlebars.precompile = _emberTemplateCompilerCompatPrecompile.default;
EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default;
EmberHandlebars.template = _emberTemplateCompilerSystemTemplate.default;
});
-enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-unescaped-inline-link-to', 'ember-template-compiler/plugins/assert-no-view-and-controller-paths', 'ember-template-compiler/plugins/assert-no-view-helper', 'ember-template-compiler/plugins/assert-no-each-in', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo, _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths, _emberTemplateCompilerPluginsAssertNoViewHelper, _emberTemplateCompilerPluginsAssertNoEachIn, _emberTemplateCompilerCompat) {
+enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-closure-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/transform-unescaped-inline-link-to', 'ember-template-compiler/plugins/assert-no-view-and-controller-paths', 'ember-template-compiler/plugins/assert-no-view-helper', 'ember-template-compiler/plugins/assert-no-each-in', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformClosureComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsTransformUnescapedInlineLinkTo, _emberTemplateCompilerPluginsAssertNoViewAndControllerPaths, _emberTemplateCompilerPluginsAssertNoViewHelper, _emberTemplateCompilerPluginsAssertNoEachIn, _emberTemplateCompilerCompat) {
'use strict';
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default);
+ _emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformClosureComponentAttrsIntoMut.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default);
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformTopLevelComponents.default);
@@ -11916,10 +11902,92 @@
return node.type === 'ComponentNode';
}
exports.default = TransformAngleBracketComponents;
});
+enifed('ember-template-compiler/plugins/transform-closure-component-attrs-into-mut', ['exports'], function (exports) {
+ 'use strict';
+
+ function TransformClosureComponentAttrsIntoMut() {
+ // set later within HTMLBars to the syntax package
+ this.syntax = null;
+ }
+
+ /**
+ @private
+ @method transform
+ @param {AST} ast The AST to be transformed.
+ */
+ TransformClosureComponentAttrsIntoMut.prototype.transform = function TransformClosureComponentAttrsIntoMut_transform(ast) {
+ var b = this.syntax.builders;
+ var walker = new this.syntax.Walker();
+
+ walker.visit(ast, function (node) {
+ if (validate(node)) {
+ processExpression(b, node);
+ }
+ });
+
+ return ast;
+ };
+
+ function processExpression(builder, node) {
+ processSubExpressionsInNode(builder, node);
+
+ if (isComponentClosure(node)) {
+ mutParameters(builder, node);
+ }
+ }
+
+ function processSubExpressionsInNode(builder, node) {
+ for (var i = 0; i < node.params.length; i++) {
+ if (node.params[i].type === 'SubExpression') {
+ processExpression(builder, node.params[i]);
+ }
+ }
+
+ each(node.hash.pairs, function (pair) {
+ var value = pair.value;
+
+ if (value.type === 'SubExpression') {
+ processExpression(builder, value);
+ }
+ });
+ }
+
+ function isComponentClosure(node) {
+ return node.type === 'SubExpression' && node.path.original === 'component';
+ }
+
+ function mutParameters(builder, node) {
+ for (var i = 1; i < node.params.length; i++) {
+ if (node.params[i].type === 'PathExpression') {
+ node.params[i] = builder.sexpr(builder.path('@mut'), [node.params[i]]);
+ }
+ }
+
+ each(node.hash.pairs, function (pair) {
+ var value = pair.value;
+
+ if (value.type === 'PathExpression') {
+ pair.value = builder.sexpr(builder.path('@mut'), [pair.value]);
+ }
+ });
+ }
+
+ function validate(node) {
+ return node.type === 'BlockStatement' || node.type === 'MustacheStatement';
+ }
+
+ function each(list, callback) {
+ for (var i = 0, l = list.length; i < l; i++) {
+ callback(list[i]);
+ }
+ }
+
+ exports.default = TransformClosureComponentAttrsIntoMut;
+});
enifed('ember-template-compiler/plugins/transform-component-attrs-into-mut', ['exports'], function (exports) {
'use strict';
function TransformComponentAttrsIntoMut() {
// set later within HTMLBars to the syntax package
@@ -12708,10 +12776,10 @@
options.plugins = plugins;
options.buildMeta = function buildMeta(program) {
return {
fragmentReason: fragmentReason(program),
- revision: 'Ember@2.5.0-beta.1',
+ revision: 'Ember@2.5.0-beta.4',
loc: program.loc,
moduleName: options.moduleName
};
};
\ No newline at end of file