dist/ember-template-compiler.js in ember-source-2.3.0.beta.1 vs dist/ember-template-compiler.js in ember-source-2.3.0.beta.3
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2015 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.3.0-beta.1
+ * @version 2.3.0-beta.3
*/
var enifed, requireModule, require, requirejs, Ember;
var mainContext = this;
@@ -1609,11 +1609,11 @@
_emberMetalDebug.setDebugFunction('deprecate', _emberDebugDeprecate.default);
_emberMetalDebug.setDebugFunction('warn', _emberDebugWarn.default);
/**
- Will call `Ember.warn()` if ENABLE_ALL_FEATURES, ENABLE_OPTIONAL_FEATURES, or
+ Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
any specific FEATURES flag is truthy.
This method is called automatically in debug canary builds.
@private
@@ -1621,11 +1621,10 @@
@return {void}
*/
function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
if (featuresWereStripped) {
- _emberMetalDebug.warn('Ember.ENV.ENABLE_ALL_FEATURES is only available in canary builds.', !_emberMetalCore.default.ENV.ENABLE_ALL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
_emberMetalDebug.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
for (var key in FEATURES) {
if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
_emberMetalDebug.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
@@ -1637,14 +1636,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;
@@ -4133,11 +4128,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.3.0-beta.1
+ @version 2.3.0-beta.3
@public
*/
'use strict';
@@ -4177,15 +4172,15 @@
/**
The semantic version.
@property VERSION
@type String
- @default '2.3.0-beta.1'
+ @default '2.3.0-beta.3'
@static
@public
*/
- Ember.VERSION = '2.3.0-beta.1';
+ Ember.VERSION = '2.3.0-beta.3';
/**
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
@@ -4206,17 +4201,17 @@
Ember.ENV = ENV;
} else {
Ember.ENV = {};
}
- Ember.config = Ember.config || {};
-
- // We disable the RANGE API by default for performance reasons
- if ('undefined' === typeof Ember.ENV.DISABLE_RANGE_API) {
- Ember.ENV.DISABLE_RANGE_API = true;
+ // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features.
+ if (Ember.ENV.ENABLE_ALL_FEATURES) {
+ Ember.ENV.ENABLE_OPTIONAL_FEATURES = Ember.ENV.ENABLE_ALL_FEATURES;
}
+ Ember.config = Ember.config || {};
+
// ..........................................................
// BOOTSTRAP
//
/**
@@ -4254,21 +4249,10 @@
@public
*/
Ember.LOG_STACKTRACE_ON_DEPRECATION = Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false;
/**
- The `SHIM_ES5` property, when true, tells Ember to add ECMAScript 5 Array
- shims to older browsers.
-
- @property SHIM_ES5
- @type Boolean
- @default Ember.EXTEND_PROTOTYPES
- @public
- */
- Ember.SHIM_ES5 = Ember.ENV.SHIM_ES5 === false ? false : Ember.EXTEND_PROTOTYPES;
-
- /**
The `LOG_VERSION` property, when true, tells Ember to log versions of all
dependent libraries in use.
@property LOG_VERSION
@type Boolean
@@ -5021,11 +5005,10 @@
Determine whether the specified `feature` is enabled. Used by Ember's
build tools to exclude experimental features from beta/stable builds.
You can define the following configuration options:
- * `EmberENV.ENABLE_ALL_FEATURES` - force all features to be enabled.
* `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly
enabled/disabled.
@method isEnabled
@param {String} feature The feature to check
@@ -5036,13 +5019,11 @@
*/
function isEnabled(feature) {
var featureValue = FEATURES[feature];
- if (_emberMetalCore.default.ENV.ENABLE_ALL_FEATURES) {
- return true;
- } else if (featureValue === true || featureValue === false || featureValue === undefined) {
+ if (featureValue === true || featureValue === false || featureValue === undefined) {
return featureValue;
} else if (_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES) {
return true;
} else {
return false;
@@ -7436,10 +7417,14 @@
MixinPrototype.applyPartial = function (obj) {
return applyMixin(obj, [this], true);
};
+ MixinPrototype.toString = function Mixin_toString() {
+ return '(unknown mixin)';
+ };
+
function _detect(curMixin, targetMixin, seen) {
var guid = _emberMetalUtils.guidFor(curMixin);
if (seen[guid]) {
return false;
@@ -11347,11 +11332,10 @@
_emberMetalComputed.computed.defaultTo = _emberMetalComputed_macros.defaultTo;
_emberMetalComputed.computed.deprecatingAlias = _emberMetalComputed_macros.deprecatingAlias;
_emberMetalComputed.computed.and = _emberMetalComputed_macros.and;
_emberMetalComputed.computed.or = _emberMetalComputed_macros.or;
_emberMetalComputed.computed.any = _emberMetalComputed_macros.any;
- _emberMetalComputed.computed.collect = _emberMetalComputed_macros.collect;
// END IMPORTS
// BEGIN EXPORTS
var EmberInstrumentation = _emberMetalCore.default.Instrumentation = {};
@@ -11485,16 +11469,11 @@
_emberMetalCore.default.isNone = _emberMetalIs_none.default;
_emberMetalCore.default.isEmpty = _emberMetalIs_empty.default;
_emberMetalCore.default.isBlank = _emberMetalIs_blank.default;
_emberMetalCore.default.isPresent = _emberMetalIs_present.default;
- if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
- _emberMetalCore.default.assign = Object.assign || _emberMetalAssign.default;
- _emberMetalCore.default.merge = _emberMetalMerge.default;
- } else {
- _emberMetalCore.default.merge = _emberMetalMerge.default;
- }
+ _emberMetalCore.default.merge = _emberMetalMerge.default;
_emberMetalCore.default.FEATURES = _emberMetalFeatures.FEATURES;
_emberMetalCore.default.FEATURES.isEnabled = _emberMetalFeatures.default;
/**
@@ -12596,11 +12575,11 @@
options.plugins = plugins;
options.buildMeta = function buildMeta(program) {
return {
fragmentReason: fragmentReason(program),
- revision: 'Ember@2.3.0-beta.1',
+ revision: 'Ember@2.3.0-beta.3',
loc: program.loc,
moduleName: options.moduleName
};
};
@@ -14249,11 +14228,11 @@
var yieldArgs = yieldTemplate(template, env, scope, morph, renderState, visitor);
return {
meta: template.meta,
arity: template.arity,
- yield: yieldArgs,
+ 'yield': yieldArgs, // quoted since it's a reserved word, see issue #420
yieldItem: yieldItem(template, env, scope, morph, renderState, visitor),
raw: template,
render: function (self, blockArguments) {
yieldArgs(blockArguments, self);
@@ -14436,11 +14415,11 @@
}
function thisFor(options) {
return {
arity: options.template.arity,
- yield: options.template.yield,
+ 'yield': options.template.yield, // quoted since it's a reserved word, see issue #420
yieldItem: options.template.yieldItem,
yieldIn: options.template.yieldIn
};
}
@@ -14925,11 +14904,12 @@
var value = env.hooks.partial(morph, env, scope, params[0]);
morph.setContent(value);
return true;
},
- yield: function (morph, env, scope, params, hash, template, inverse, visitor) {
+ // quoted since it's a reserved word, see issue #420
+ 'yield': function (morph, env, scope, params, hash, template, inverse, visitor) {
// the current scope is provided purely for the creation of shadow
// scopes; it should not be provided to user code.
var to = env.hooks.getValue(hash.to) || 'default';
var block = env.hooks.getBlock(scope, to);
@@ -18131,10 +18111,12 @@
var _currentNode = this.currentNode;
var name = _currentNode.name;
var attributes = _currentNode.attributes;
var modifiers = _currentNode.modifiers;
+ validateStartTag(this.currentNode, this.tokenizer);
+
var loc = _htmlbarsSyntaxBuilders.default.loc(this.tokenizer.tagLine, this.tokenizer.tagColumn);
var element = _htmlbarsSyntaxBuilders.default.element(name, attributes, modifiers, [], loc);
this.elementStack.push(element);
},
@@ -18249,27 +18231,28 @@
}
return _htmlbarsSyntaxBuilders.default.concat(parts);
}
- function validateEndTag(tag, element, selfClosing) {
- var error;
+ function validateStartTag(tag, tokenizer) {
+ // No support for <script> tags
+ if (tag.name === "script") {
+ throw new Error("`SCRIPT` tags are not allowed in HTMLBars templates (on line " + tokenizer.tagLine + ")");
+ }
+ }
+ function validateEndTag(tag, element, selfClosing) {
if (_htmlbarsUtilVoidTagNames.default[tag.name] && !selfClosing) {
// EngTag is also called by StartTag for void and self-closing tags (i.e.
// <input> or <br />, so we need to check for that here. Otherwise, we would
// throw an error for those cases.
- error = "Invalid end tag " + formatEndTagInfo(tag) + " (void elements cannot have end tags).";
+ throw new Error("Invalid end tag " + formatEndTagInfo(tag) + " (void elements cannot have end tags).");
} else if (element.tag === undefined) {
- error = "Closing tag " + formatEndTagInfo(tag) + " without an open tag.";
+ throw new Error("Closing tag " + formatEndTagInfo(tag) + " without an open tag.");
} else if (element.tag !== tag.name) {
- error = "Closing tag " + formatEndTagInfo(tag) + " did not match last open tag `" + element.tag + "` (on line " + element.loc.start.line + ").";
+ throw new Error("Closing tag " + formatEndTagInfo(tag) + " did not match last open tag `" + element.tag + "` (on line " + element.loc.start.line + ").");
}
-
- if (error) {
- throw new Error(error);
- }
}
function formatEndTagInfo(tag) {
return "`" + tag.name + "` (on line " + tag.loc.end.line + ")";
}
@@ -19375,11 +19358,11 @@
var next = item.nextMorph;
// If we don't see the key in handledMorphs, it wasn't
// yielded in and we can safely remove it from DOM.
if (!(item.key in handledMorphs)) {
- delete morphMap[item.key];
+ morphMap[item.key] = undefined;
clearMorph(item, env, true);
item.destroy();
}
item = next;
@@ -19438,10 +19421,10 @@
function clearMorphList(morphList, morph, env) {
var item = morphList.firstChildMorph;
while (item) {
var next = item.nextMorph;
- delete morph.morphMap[item.key];
+ morph.morphMap[item.key] = undefined;
clearMorph(item, env, true);
item.destroy();
item = next;
}
\ No newline at end of file