dist/globals/ember-data.prod.js in ember-data-source-2.15.0.beta.1 vs dist/globals/ember-data.prod.js in ember-data-source-2.15.0.beta.2

- old
+ new

@@ -4,11 +4,11 @@ /*! * @overview Ember Data * @copyright Copyright 2011-2017 Tilde Inc. and contributors. * Portions Copyright 2011 LivingSocial Inc. * @license Licensed under MIT license (see license.js) - * @version 2.15.0-beta.1 + * @version 2.15.0-beta.2 */ var loader, define, requireModule, require, requirejs; (function (global) { @@ -30,13 +30,13 @@ requireModule: requireModule, require: require, requirejs: requirejs }; - requirejs = require = requireModule = function (id) { + requirejs = require = requireModule = function (name) { var pending = []; - var mod = findModule(id, '(require)', pending); + var mod = findModule(name, '(require)', pending); for (var i = pending.length - 1; i >= 0; i--) { pending[i].exports(); } @@ -58,24 +58,33 @@ } } } }; + var _isArray; + if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + _isArray = Array.isArray; + } + var registry = dict(); var seen = dict(); var uuid = 0; function unsupportedModule(length) { - throw new Error('an unsupported module was defined, expected `define(id, deps, module)` instead got: `' + length + '` arguments to define`'); + throw new Error('an unsupported module was defined, expected `define(name, deps, module)` instead got: `' + length + '` arguments to define`'); } var defaultDeps = ['require', 'exports', 'module']; - function Module(id, deps, callback, alias) { - this.uuid = uuid++; - this.id = id; + function Module(name, deps, callback, alias) { + this.id = uuid++; + this.name = name; this.deps = !deps.length && callback.length ? defaultDeps : deps; this.module = { exports: {} }; this.callback = callback; this.hasExportsAsDep = false; this.isAlias = alias; @@ -106,17 +115,16 @@ if (this.state === 'finalized' || this.state === 'reifying') { return this.module.exports; } if (loader.wrapModules) { - this.callback = loader.wrapModules(this.id, this.callback); + this.callback = loader.wrapModules(this.name, this.callback); } this.reify(); var result = this.callback.apply(this, this.reified); - this.reified.length = 0; this.state = 'finalized'; if (!(this.hasExportsAsDep && result === undefined)) { this.module.exports = result; } @@ -171,117 +179,93 @@ } else if (dep === 'require') { entry.exports = this.makeRequire(); } else if (dep === 'module') { entry.exports = this.module; } else { - entry.module = findModule(resolve(dep, this.id), this.id, pending); + entry.module = findModule(resolve(dep, this.name), this.name, pending); } } }; Module.prototype.makeRequire = function () { - var id = this.id; + var name = this.name; var r = function (dep) { - return require(resolve(dep, id)); + return require(resolve(dep, name)); }; r['default'] = r; - r.moduleId = id; r.has = function (dep) { - return has(resolve(dep, id)); + return has(resolve(dep, name)); }; return r; }; - define = function (id, deps, callback) { - var module = registry[id]; + define = function (name, deps, callback) { + var module = registry[name]; - // If a module for this id has already been defined and is in any state + // If a module for this name has already been defined and is in any state // other than `new` (meaning it has been or is currently being required), // then we return early to avoid redefinition. if (module && module.state !== 'new') { return; } if (arguments.length < 2) { unsupportedModule(arguments.length); } - if (!Array.isArray(deps)) { + if (!_isArray(deps)) { callback = deps; deps = []; } if (callback instanceof Alias) { - registry[id] = new Module(callback.id, deps, callback, true); + registry[name] = new Module(callback.name, deps, callback, true); } else { - registry[id] = new Module(id, deps, callback, false); + registry[name] = new Module(name, deps, callback, false); } }; - define.exports = function (name, defaultExport) { - var module = registry[name]; - - // If a module for this name has already been defined and is in any state - // other than `new` (meaning it has been or is currently being required), - // then we return early to avoid redefinition. - if (module && module.state !== 'new') { - return; - } - - module = new Module(name, [], noop, null); - module.module.exports = defaultExport; - module.state = 'finalized'; - registry[name] = module; - - return module; - }; - - function noop() {} // we don't support all of AMD // define.amd = {}; - function Alias(id) { - this.id = id; + function Alias(path) { + this.name = path; } - define.alias = function (id, target) { - if (arguments.length === 2) { - return define(target, new Alias(id)); - } - - return new Alias(id); + define.alias = function (path) { + return new Alias(path); }; - function missingModule(id, referrer) { - throw new Error('Could not find module `' + id + '` imported from `' + referrer + '`'); + function missingModule(name, referrer) { + throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`'); } - function findModule(id, referrer, pending) { - var mod = registry[id] || registry[id + '/index']; + function findModule(name, referrer, pending) { + var mod = registry[name] || registry[name + '/index']; while (mod && mod.isAlias) { - mod = registry[mod.id]; + mod = registry[mod.name]; } if (!mod) { - missingModule(id, referrer); + missingModule(name, referrer); } if (pending && mod.state !== 'pending' && mod.state !== 'finalized') { mod.findDeps(pending); pending.push(mod); } return mod; } - function resolve(child, id) { + function resolve(child, name) { if (child.charAt(0) !== '.') { return child; } var parts = child.split('/'); - var nameParts = id.split('/'); + var nameParts = name.split('/'); var parentBase = nameParts.slice(0, -1); for (var i = 0, l = parts.length; i < l; i++) { var part = parts[i]; @@ -298,18 +282,18 @@ } return parentBase.join('/'); } - function has(id) { - return !!(registry[id] || registry[id + '/index']); + function has(name) { + return !!(registry[name] || registry[name + '/index']); } requirejs.entries = requirejs._eak_seen = registry; requirejs.has = has; - requirejs.unsee = function (id) { - findModule(id, '(unsee)', false).unsee(); + requirejs.unsee = function (moduleName) { + findModule(moduleName, '(unsee)', false).unsee(); }; requirejs.clear = function () { requirejs.entries = requirejs._eak_seen = registry = dict(); seen = dict(); @@ -324,16 +308,13 @@ require('foo/bar'); } }); define('foo/baz', [], define.alias('foo')); define('foo/quz', define.alias('foo')); - define.alias('foo', 'foo/qux'); define('foo/bar', ['foo', './quz', './baz', './asdf', './bar', '../foo'], function () {}); define('foo/main', ['foo/bar'], function () {}); - define.exports('foo/exports', {}); - require('foo/exports'); require('foo/main'); require.unsee('foo/bar'); requirejs.clear(); @@ -8389,16 +8370,17 @@ var inverseRelationshipData = { data: { id: id, type: modelName } + }; - // start flushing this individual payload. The logic is the same whether - // it's for the left hand side of the relationship or the right hand side, - // except the role of primary and inverse idToPayloads is reversed - // - };var previousPayload = void 0; + // start flushing this individual payload. The logic is the same whether + // it's for the left hand side of the relationship or the right hand side, + // except the role of primary and inverse idToPayloads is reversed + // + var previousPayload = void 0; var idToPayloads = void 0; var inverseIdToPayloads = void 0; var inverseIsMany = void 0; if (this._isLHS(modelName, relationshipName)) { previousPayload = this._lhsPayloads[id]; @@ -10287,11 +10269,13 @@ internalModel.loadedData(); var record = internalModel.getRecord(properties); // TODO @runspired this should also be coalesced into some form of internalModel.setState() internalModel.eachRelationship(function (key, descriptor) { - internalModel._relationships.get(key).setHasData(true); + if (properties[key] !== undefined) { + internalModel._relationships.get(key).setHasData(true); + } }); return record; }, @@ -13138,11 +13122,11 @@ break; } } if (foundSep === false) { - break; + continue; } var field = header.substring(0, j).trim(); var value = header.substring(j + 1, header.length).trim(); @@ -18280,10 +18264,10 @@ }); define("ember-data/version", ["exports"], function (exports) { "use strict"; exports.__esModule = true; - exports.default = "2.15.0-beta.1"; + exports.default = "2.15.0-beta.2"; }); define("ember-inflector", ["module", "exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _ember, _system) { "use strict"; exports.__esModule = true;