dist/ember.js in ember-source-1.13.4 vs dist/ember.js in ember-source-1.13.4.1

- old
+ new

@@ -1491,13 +1491,13 @@ enifed('container/registry', ['exports', 'ember-metal/core', 'ember-metal/dictionary', 'ember-metal/keys', 'ember-metal/merge', './container'], function (exports, _emberMetalCore, _emberMetalDictionary, _emberMetalKeys, _emberMetalMerge, _container) { var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/; var instanceInitializersFeatureEnabled; - if (_emberMetalCore["default"].FEATURES.isEnabled('ember-application-instance-initializers')) { + instanceInitializersFeatureEnabled = true; - } + /** A registry used to store factory and option information keyed by type. @@ -3994,25 +3994,15 @@ // Start off the number of deferrals at 1. This will be // decremented by the Application's own `initialize` method. this._readinessDeferrals = 1; - if (_emberMetal["default"].FEATURES.isEnabled('ember-application-visit')) { - if (this.autoboot) { - // Create subclass of Ember.Router for this Application instance. - // This is to ensure that someone reopening `App.Router` does not - // tamper with the default `Ember.Router`. - // 2.0TODO: Can we move this into a globals-mode-only library? - this.Router = (this.Router || _emberRoutingSystemRouter["default"]).extend(); - this.buildDefaultInstance(); - this.waitForDOMReady(); - } - } else { + this.Router = (this.Router || _emberRoutingSystemRouter["default"]).extend(); this.buildDefaultInstance(); this.waitForDOMReady(); - } + }, /** Build and configure the registry for the current application. @private @@ -4337,17 +4327,13 @@ runInitializers: function (registry) { var App = this; this._runInitializer('initializers', function (name, initializer) { _emberMetal["default"].assert('No application initializer named \'' + name + '\'', !!initializer); - if (_emberMetal["default"].FEATURES.isEnabled('ember-application-initializer-context')) { + initializer.initialize(registry, App); - } else { - var ref = initializer.initialize; - ref(registry, App); - } - }); + }); }, runInstanceInitializers: function (instance) { this._runInitializer('instanceInitializers', function (name, initializer) { _emberMetal["default"].assert('No instance initializer named \'' + name + '\'', !!initializer); @@ -4445,57 +4431,23 @@ this._super.apply(this, arguments); } }); - if (_emberMetal["default"].FEATURES.isEnabled('ember-application-instance-initializers')) { + Application.reopen({ instanceInitializer: function (options) { this.constructor.instanceInitializer(options); } }); Application.reopenClass({ instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer') }); - } + - if (_emberMetal["default"].FEATURES.isEnabled('ember-application-visit')) { - Application.reopen({ - /** - Creates a new instance of the application and instructs it to route to the - specified initial URL. This method returns a promise that will be resolved - once rendering is complete. That promise is resolved with the instance. - ```js - App.visit('/users').then(function(instance) { - var view = instance.view; - view.appendTo('#qunit-test-fixtures'); - }); - ``` - @method visit - @private - */ - visit: function (url) { - var instance = this.buildInstance(); - this.runInstanceInitializers(instance); - - var renderPromise = new _emberMetal["default"].RSVP.Promise(function (res, rej) { - instance.didCreateRootView = function (view) { - instance.view = view; - res(instance); - }; - }); - - instance.overrideRouterLocation({ location: 'none' }); - - return instance.handleURL(url).then(function () { - return renderPromise; - }); - } - }); - } - + Application.reopenClass({ initializers: _emberMetalPlatformCreate["default"](null), instanceInitializers: _emberMetalPlatformCreate["default"](null), /** @@ -5565,14 +5517,11 @@ if (!_emberMetalCore["default"].testing) { // Complain if they're using FEATURE flags in builds other than canary _emberMetalCore["default"].FEATURES["features-stripped-test"] = true; var featuresWereStripped = true; - if (_emberMetalCore["default"].FEATURES.isEnabled("features-stripped-test")) { - featuresWereStripped = false; - } - + delete _emberMetalCore["default"].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; @@ -6278,14 +6227,14 @@ makeBoundHelper: _emberHtmlbarsSystemMake_bound_helper["default"], registerPlugin: _emberTemplateCompiler.registerPlugin, DOMHelper: _emberHtmlbarsSystemDomHelper["default"] }; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-htmlbars-helper")) { + _emberHtmlbarsHelper["default"].helper = _emberHtmlbarsHelper.helper; _emberMetalCore["default"].Helper = _emberHtmlbarsHelper["default"]; - } + }); /** &nbsp; @@ -10220,11 +10169,11 @@ function discoverKnownHelpers(container) { var registry = container && container._registry; var helpers = _emberMetalDictionary["default"](null); - if (_emberMetalCore["default"].FEATURES.isEnabled('ember-htmlbars-dashless-helpers')) { + if (!registry) { return helpers; } var known = registry.knownForType('helper'); @@ -10234,11 +10183,11 @@ var fullName = knownContainerKeys[index]; var _name = fullName.slice(7); // remove `helper:` from fullName helpers[_name] = true; } - } + return helpers; } }); enifed("ember-htmlbars/system/dom-helper", ["exports", "dom-helper", "ember-htmlbars/morphs/morph", "ember-htmlbars/morphs/attr-morph", "ember-metal/platform/create"], function (exports, _domHelper, _emberHtmlbarsMorphsMorph, _emberHtmlbarsMorphsAttrMorph, _emberMetalPlatformCreate) { @@ -12041,27 +11990,11 @@ _emberMetalCore["default"].isBlank = _emberMetalIs_blank["default"]; _emberMetalCore["default"].isPresent = _emberMetalIs_present["default"]; _emberMetalCore["default"].merge = _emberMetalMerge["default"]; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-metal-stream")) { - _emberMetalCore["default"].stream = { - Stream: _emberMetalStreamsStream["default"], - - isStream: _emberMetalStreamsUtils.isStream, - subscribe: _emberMetalStreamsUtils.subscribe, - unsubscribe: _emberMetalStreamsUtils.unsubscribe, - read: _emberMetalStreamsUtils.read, - readHash: _emberMetalStreamsUtils.readHash, - readArray: _emberMetalStreamsUtils.readArray, - scanArray: _emberMetalStreamsUtils.scanArray, - scanHash: _emberMetalStreamsUtils.scanHash, - concat: _emberMetalStreamsUtils.concat, - chain: _emberMetalStreamsUtils.chain - }; - } - + /** A function may be assigned to `Ember.onerror` to be called when Ember internals encounter an error. This is useful for specialized error handling and reporting code. @@ -16570,16 +16503,11 @@ callback(lib.name, lib.version); }); } }; - if (_emberMetalCore["default"].FEATURES.isEnabled("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) { function K() { @@ -18951,32 +18879,29 @@ } if (desc instanceof Descriptor) { value = desc; - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (watching && _emberMetalPlatformDefine_property.hasPropertyAccessors) { _emberMetalPlatformDefine_property.defineProperty(obj, keyName, { configurable: true, enumerable: true, writable: true, value: value }); } else { obj[keyName] = value; } - } else { - obj[keyName] = value; - } - if (desc.setup) { + if (desc.setup) { desc.setup(obj, keyName); } } else { if (desc == null) { value = data; - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (watching && _emberMetalPlatformDefine_property.hasPropertyAccessors) { meta.values[keyName] = data; _emberMetalPlatformDefine_property.defineProperty(obj, keyName, { configurable: true, enumerable: true, @@ -18984,14 +18909,11 @@ get: DEFAULT_GETTER_FUNCTION(keyName) }); } else { obj[keyName] = data; } - } else { - obj[keyName] = data; - } - } else { + } else { value = desc; // compatibility with ES5 _emberMetalPlatformDefine_property.defineProperty(obj, keyName, desc); } @@ -19408,20 +19330,17 @@ } if (desc) { return desc.get(obj, keyName); } else { - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors && meta && meta.watching[keyName] > 0) { ret = meta.values[keyName]; } else { ret = obj[keyName]; } - } else { - ret = obj[keyName]; - } - + if (ret === undefined && "object" === typeof obj && !(keyName in obj) && "function" === typeof obj.unknownProperty) { return obj.unknownProperty(keyName); } return ret; @@ -19592,37 +19511,31 @@ // `setUnknownProperty` method exists on the object if (isUnknown && "function" === typeof obj.setUnknownProperty) { obj.setUnknownProperty(keyName, value); } else if (meta && meta.watching[keyName] > 0) { if (meta.proto !== obj) { - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { currentValue = meta.values[keyName]; } else { currentValue = obj[keyName]; } - } else { - currentValue = obj[keyName]; - } - } + } // only trigger a change if the value has changed if (value !== currentValue) { _emberMetalProperty_events.propertyWillChange(obj, keyName); - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { if (currentValue === undefined && !(keyName in obj) || !Object.prototype.propertyIsEnumerable.call(obj, keyName)) { _emberMetalProperties.defineProperty(obj, keyName, null, value); // setup mandatory setter } else { meta.values[keyName] = value; } } else { obj[keyName] = value; } - } else { - obj[keyName] = value; - } - _emberMetalProperty_events.propertyDidChange(obj, keyName); + _emberMetalProperty_events.propertyDidChange(obj, keyName); } } else { obj[keyName] = value; if (obj[_emberMetalProperty_events.PROPERTY_DID_CHANGE]) { obj[_emberMetalProperty_events.PROPERTY_DID_CHANGE](keyName); @@ -21695,15 +21608,15 @@ } // Placeholder for non-writable metas. var EMPTY_META = new Meta(null); - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { EMPTY_META.values = {}; } - } + /** Retrieves the meta hash for an object. If `writable` is true ensures the hash is writable for this object as well. @@ -21736,15 +21649,15 @@ } } ret = new Meta(obj); - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { ret.values = {}; } - } + obj.__ember_meta__ = ret; } else if (ret.source !== obj) { if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(EMBER_META_PROPERTY); @@ -21756,15 +21669,15 @@ ret.watching = _emberMetalPlatformCreate["default"](ret.watching); ret.cache = undefined; ret.cacheMeta = undefined; ret.source = obj; - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { ret.values = _emberMetalPlatformCreate["default"](ret.values); } - } + obj["__ember_meta__"] = ret; } return ret; } @@ -22313,21 +22226,21 @@ if ("function" === typeof obj.willWatchProperty) { obj.willWatchProperty(keyName); } - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { handleMandatorySetter(m, obj, keyName); } - } + } else { watching[keyName] = (watching[keyName] || 0) + 1; } } - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + var handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) { var descriptor = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(obj, keyName); var configurable = descriptor ? descriptor.configurable : true; var isWritable = descriptor ? descriptor.writable : true; var hasValue = descriptor ? "value" in descriptor : true; @@ -22347,11 +22260,11 @@ set: _emberMetalProperties.MANDATORY_SETTER_FUNCTION(keyName), get: _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName) }); } }; - } + // This is super annoying, but required until // https://github.com/babel/babel/issues/906 is resolved ; // jshint ignore:line @@ -22370,11 +22283,11 @@ if ("function" === typeof obj.didUnwatchProperty) { obj.didUnwatchProperty(keyName); } - if (_emberMetalCore["default"].FEATURES.isEnabled("mandatory-setter")) { + if (!desc && _emberMetalPlatformDefine_property.hasPropertyAccessors && keyName in obj) { _emberMetalPlatformDefine_property.defineProperty(obj, keyName, { configurable: true, enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName), set: function (val) { @@ -22388,11 +22301,11 @@ delete m.values[keyName]; }, get: _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName) }); } - } + } else if (watching[keyName] > 1) { watching[keyName]--; } } }); @@ -22959,16 +22872,13 @@ var getStream = env.hooks.get; var read = env.hooks.getValue; var actionName = read(params[0]); - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-htmlbars-improved-actions")) { + assert("You specified a quoteless path to the {{action}} helper " + "which did not resolve to an action name (a string). " + "Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).", typeof actionName === "string" || typeof actionName === "function"); - } else { - assert("You specified a quoteless path to the {{action}} helper " + "which did not resolve to an action name (a string). " + "Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).", typeof actionName === "string"); - } - + var actionArgs = []; for (var i = 1, l = params.length; i < l; i++) { actionArgs.push(_emberViewsStreamsUtils.readUnwrappedModel(params[i])); } @@ -23050,16 +22960,16 @@ var target = _node$state.target; var actionName = _node$state.actionName; var actionArgs = _node$state.actionArgs; _emberMetalRun_loop["default"](function runRegisteredAction() { - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-htmlbars-improved-actions")) { + if (typeof actionName === "function") { actionName.apply(target, actionArgs); return; } - } + if (target.send) { target.send.apply(target, [actionName].concat(actionArgs)); } else { _emberMetalCore["default"].assert("The action '" + actionName + "' did not exist on " + target, typeof target[actionName] === "function"); @@ -23639,27 +23549,24 @@ enifed("ember-routing-views", ["exports", "ember-metal/core", "ember-routing-views/views/link", "ember-routing-views/views/outlet"], function (exports, _emberMetalCore, _emberRoutingViewsViewsLink, _emberRoutingViewsViewsOutlet) { _emberMetalCore["default"].LinkView = _emberRoutingViewsViewsLink.DeprecatedLinkView; _emberMetalCore["default"].LinkComponent = _emberRoutingViewsViewsLink["default"]; _emberMetalCore["default"].OutletView = _emberRoutingViewsViewsOutlet.OutletView; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-core-outlet")) { - _emberMetalCore["default"].CoreOutletView = _emberRoutingViewsViewsOutlet.CoreOutletView; - } - + exports["default"] = _emberMetalCore["default"]; }); /** @module ember @submodule ember-routing-views */ enifed("ember-routing-views/views/link", ["exports", "ember-metal/core", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/computed", "ember-views/system/utils", "ember-views/views/component", "ember-runtime/inject", "ember-runtime/mixins/controller", "ember-htmlbars/templates/link-to"], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeMixinsController, _emberHtmlbarsTemplatesLinkTo) { _emberHtmlbarsTemplatesLinkTo["default"].meta.revision = "Ember@1.13.4"; var linkComponentClassNameBindings = ["active", "loading", "disabled"]; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-transitioning-classes")) { + linkComponentClassNameBindings = ["active", "loading", "disabled", "transitioningIn", "transitioningOut"]; - } + /** `Ember.LinkComponent` renders an element whose `click` event triggers a transition of the application's instance of `Ember.Router` to a supplied route by name. @@ -25858,16 +25765,16 @@ } return _emberMetalArray.indexOf.call(["array", "basic", "object", "application"], name) === -1; })()); - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-named-substates")) { + if (this.enableLoadingSubstates) { createRoute(this, name + "_loading", { resetNamespace: options.resetNamespace }); createRoute(this, name + "_error", { path: dummyErrorRoute }); } - } + if (callback) { var fullName = getFullName(this, name, options.resetNamespace); var dsl = new DSL(fullName, { enableLoadingSubstates: this.enableLoadingSubstates @@ -28402,15 +28309,15 @@ router.didTransition = function (infos) { emberRouter.didTransition(infos); }; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-router-willtransition")) { + router.willTransition = function (oldInfos, newInfos, transition) { emberRouter.willTransition(oldInfos, newInfos, transition); }; - } + }, _serializeQueryParams: function (targetRouteName, queryParams) { var groupedByUrlKey = {}; @@ -28717,17 +28624,17 @@ var router = parentRoute.router; var childName; var targetChildRouteName = originatingChildRoute.routeName.split(".").pop(); var namespace = parentRoute.routeName === "application" ? "" : parentRoute.routeName + "."; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-routing-named-substates")) { + // First, try a named loading state, e.g. 'foo_loading' childName = namespace + targetChildRouteName + "_" + name; if (routeHasBeenDefined(router, childName)) { return childName; } - } + // Second, try general loading state, e.g. 'loading' childName = namespace + name; if (routeHasBeenDefined(router, childName)) { return childName; @@ -36622,20 +36529,17 @@ desc.set(this, keyName, value); } else { if (typeof this.setUnknownProperty === "function" && !(keyName in this)) { this.setUnknownProperty(keyName, value); } else { - if (_emberMetal["default"].FEATURES.isEnabled("mandatory-setter")) { + if (_emberMetalPlatformDefine_property.hasPropertyAccessors) { _emberMetalProperties.defineProperty(this, keyName, null, value); // setup mandatory setter } else { this[keyName] = value; } - } else { - this[keyName] = value; - } - } + } } } } } @@ -40887,14 +40791,11 @@ @property compileOptions */ exports["default"] = function (_options) { var disableComponentGeneration = true; - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-htmlbars-component-generation")) { - disableComponentGeneration = false; - } - + var options = undefined; // When calling `Ember.Handlebars.compile()` a second argument of `true` // had a special meaning (long since lost), this just gaurds against // `options` being true, and causing an error during compilation. if (_options === true) { @@ -41378,43 +41279,10 @@ @return {RSVP.Promise} @public */ asyncHelper("click", click); - if (_emberMetalCore["default"].FEATURES.isEnabled("ember-testing-checkbox-helpers")) { /** - Checks a checkbox. Ensures the presence of the `checked` attribute - Example: - ```javascript - check('#remember-me').then(function() { - // assert something - }); - ``` - @method check - @param {String} selector jQuery selector finding an `input[type="checkbox"]` - element on the DOM to check - @return {RSVP.Promise} - @private - */ - asyncHelper("check", check); - - /** - Unchecks a checkbox. Ensures the absence of the `checked` attribute - Example: - ```javascript - uncheck('#remember-me').then(function() { - // assert something - }); - ``` - @method check - @param {String} selector jQuery selector finding an `input[type="checkbox"]` - element on the DOM to uncheck - @return {RSVP.Promise} - @private - */ - asyncHelper("uncheck", uncheck); - } - /** Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode Example: ```javascript \ No newline at end of file