mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Update vendors.
Former-commit-id: 1e711564671134b82eed980bccb628af612ae195
This commit is contained in:
@@ -4,4 +4,4 @@ node_js:
|
|||||||
- 0.8
|
- 0.8
|
||||||
before_script:
|
before_script:
|
||||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d | tar xvz -C vendor"
|
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d | tar xvz -C vendor"
|
||||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/827f406a02626c1c6723e8ae281b6785d36375c1 | tar xvz -C vendor"
|
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/9869c4443fb22598235d1019fcc8245be41e8889 | tar xvz -C vendor"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
var closureId = 'aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d';
|
var closureId = 'aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d';
|
||||||
|
|
||||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||||
var uglifyId = '827f406a02626c1c6723e8ae281b6785d36375c1';
|
var uglifyId = '9869c4443fb22598235d1019fcc8245be41e8889';
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
11
vendor/backbone/backbone.js
vendored
11
vendor/backbone/backbone.js
vendored
@@ -62,7 +62,7 @@
|
|||||||
Backbone.emulateJSON = false;
|
Backbone.emulateJSON = false;
|
||||||
|
|
||||||
// Backbone.Events
|
// Backbone.Events
|
||||||
// -----------------
|
// ---------------
|
||||||
|
|
||||||
// Regular expression used to split event strings
|
// Regular expression used to split event strings
|
||||||
var eventSplitter = /\s+/;
|
var eventSplitter = /\s+/;
|
||||||
@@ -892,7 +892,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Backbone.Router
|
// Backbone.Router
|
||||||
// -------------------
|
// ---------------
|
||||||
|
|
||||||
// Routers map faux-URLs to actions, and fire events when routes are
|
// Routers map faux-URLs to actions, and fire events when routes are
|
||||||
// matched. Creating a new one sets its `routes` hash, if not set statically.
|
// matched. Creating a new one sets its `routes` hash, if not set statically.
|
||||||
@@ -1313,10 +1313,7 @@
|
|||||||
// attached directly to the view.
|
// attached directly to the view.
|
||||||
_configure: function(options) {
|
_configure: function(options) {
|
||||||
if (this.options) options = _.extend({}, this.options, options);
|
if (this.options) options = _.extend({}, this.options, options);
|
||||||
for (var i = 0, l = viewOptions.length; i < l; i++) {
|
_.extend(this, _.pick(options, viewOptions));
|
||||||
var attr = viewOptions[i];
|
|
||||||
if (options[attr]) this[attr] = options[attr];
|
|
||||||
}
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1466,7 +1463,7 @@
|
|||||||
return child;
|
return child;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set up inheritance for the model, collection, router, and view.
|
// Set up inheritance for the model, collection, router, view and history.
|
||||||
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
|
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
|
||||||
|
|
||||||
// Throw an error when a URL is needed, and none is supplied.
|
// Throw an error when a URL is needed, and none is supplied.
|
||||||
|
|||||||
7
vendor/backbone/test/view.js
vendored
7
vendor/backbone/test/view.js
vendored
@@ -7,17 +7,20 @@ $(document).ready(function() {
|
|||||||
setup: function() {
|
setup: function() {
|
||||||
view = new Backbone.View({
|
view = new Backbone.View({
|
||||||
id : 'test-view',
|
id : 'test-view',
|
||||||
className : 'test-view'
|
className : 'test-view',
|
||||||
|
other : 'non-special-option'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("constructor", 4, function() {
|
test("constructor", 6, function() {
|
||||||
equal(view.el.id, 'test-view');
|
equal(view.el.id, 'test-view');
|
||||||
equal(view.el.className, 'test-view');
|
equal(view.el.className, 'test-view');
|
||||||
|
equal(view.el.other, void 0);
|
||||||
equal(view.options.id, 'test-view');
|
equal(view.options.id, 'test-view');
|
||||||
equal(view.options.className, 'test-view');
|
equal(view.options.className, 'test-view');
|
||||||
|
equal(view.options.other, 'non-special-option');
|
||||||
});
|
});
|
||||||
|
|
||||||
test("jQuery", 1, function() {
|
test("jQuery", 1, function() {
|
||||||
|
|||||||
14
vendor/qunit/README.md
vendored
14
vendor/qunit/README.md
vendored
@@ -1,4 +1,4 @@
|
|||||||
[QUnit](http://docs.jquery.com/QUnit) - A JavaScript Unit Testing framework.
|
[QUnit](http://qunitjs.com) - A JavaScript Unit Testing framework.
|
||||||
================================
|
================================
|
||||||
|
|
||||||
QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery
|
QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery
|
||||||
@@ -35,7 +35,8 @@ the change, run `grunt` to lint and test it, then commit, push and create a pull
|
|||||||
Include some background for the change in the commit message and `Fixes #nnn`, referring
|
Include some background for the change in the commit message and `Fixes #nnn`, referring
|
||||||
to the issue number you're addressing.
|
to the issue number you're addressing.
|
||||||
|
|
||||||
To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`.
|
To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global
|
||||||
|
grunt binary. For additional grunt tasks, also run `npm install`.
|
||||||
|
|
||||||
Releases
|
Releases
|
||||||
--------
|
--------
|
||||||
@@ -47,3 +48,12 @@ tag, update them again to the next version, commit and push commits and tags
|
|||||||
|
|
||||||
Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits
|
Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits
|
||||||
or whitespace cleanups.
|
or whitespace cleanups.
|
||||||
|
|
||||||
|
To upload to code.jquery.com (replace $version accordingly):
|
||||||
|
|
||||||
|
scp -q qunit/qunit.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.js
|
||||||
|
scp -q qunit/qunit.css jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.css
|
||||||
|
|
||||||
|
Then update /var/www/html/code.jquery.com/index.html and purge it with:
|
||||||
|
|
||||||
|
curl -s http://code.origin.jquery.com/?reload
|
||||||
16
vendor/qunit/qunit/qunit.css
vendored
16
vendor/qunit/qunit/qunit.css
vendored
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* QUnit v1.9.0 - A JavaScript Unit Testing Framework
|
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
|
||||||
*
|
*
|
||||||
* http://docs.jquery.com/QUnit
|
* http://qunitjs.com
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012 John Resig, Jörn Zaefferer
|
* Copyright 2012 jQuery Foundation and other contributors
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
* Released under the MIT license.
|
||||||
* or GPL (GPL-LICENSE.txt) licenses.
|
* http://jquery.org/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Font Family and Sizes */
|
/** Font Family and Sizes */
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/** Resets */
|
/** Resets */
|
||||||
|
|
||||||
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
|
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -67,6 +67,7 @@
|
|||||||
padding: 0.5em 0 0.5em 2em;
|
padding: 0.5em 0 0.5em 2em;
|
||||||
color: #5E740B;
|
color: #5E740B;
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#qunit-userAgent {
|
#qunit-userAgent {
|
||||||
@@ -76,6 +77,9 @@
|
|||||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#qunit-modulefilter-container {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
/** Tests: Pass/Fail */
|
/** Tests: Pass/Fail */
|
||||||
|
|
||||||
|
|||||||
89
vendor/qunit/qunit/qunit.js
vendored
89
vendor/qunit/qunit/qunit.js
vendored
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* QUnit v1.9.0 - A JavaScript Unit Testing Framework
|
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
|
||||||
*
|
*
|
||||||
* http://docs.jquery.com/QUnit
|
* http://qunitjs.com
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012 John Resig, Jörn Zaefferer
|
* Copyright 2012 jQuery Foundation and other contributors
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
* Released under the MIT license.
|
||||||
* or GPL (GPL-LICENSE.txt) licenses.
|
* http://jquery.org/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function( window ) {
|
(function( window ) {
|
||||||
@@ -17,6 +17,8 @@ var QUnit,
|
|||||||
fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
|
fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
|
||||||
toString = Object.prototype.toString,
|
toString = Object.prototype.toString,
|
||||||
hasOwn = Object.prototype.hasOwnProperty,
|
hasOwn = Object.prototype.hasOwnProperty,
|
||||||
|
// Keep a local reference to Date (GH-283)
|
||||||
|
Date = window.Date,
|
||||||
defined = {
|
defined = {
|
||||||
setTimeout: typeof window.setTimeout !== "undefined",
|
setTimeout: typeof window.setTimeout !== "undefined",
|
||||||
sessionStorage: (function() {
|
sessionStorage: (function() {
|
||||||
@@ -304,7 +306,8 @@ QUnit = {
|
|||||||
// call on start of module test to prepend name to all tests
|
// call on start of module test to prepend name to all tests
|
||||||
module: function( name, testEnvironment ) {
|
module: function( name, testEnvironment ) {
|
||||||
config.currentModule = name;
|
config.currentModule = name;
|
||||||
config.currentModuleTestEnviroment = testEnvironment;
|
config.currentModuleTestEnvironment = testEnvironment;
|
||||||
|
config.modules[name] = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
asyncTest: function( testName, expected, callback ) {
|
asyncTest: function( testName, expected, callback ) {
|
||||||
@@ -336,7 +339,7 @@ QUnit = {
|
|||||||
async: async,
|
async: async,
|
||||||
callback: callback,
|
callback: callback,
|
||||||
module: config.currentModule,
|
module: config.currentModule,
|
||||||
moduleTestEnvironment: config.currentModuleTestEnviroment,
|
moduleTestEnvironment: config.currentModuleTestEnvironment,
|
||||||
stack: sourceFromStacktrace( 2 )
|
stack: sourceFromStacktrace( 2 )
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -349,7 +352,11 @@ QUnit = {
|
|||||||
|
|
||||||
// Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
|
// Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
|
||||||
expect: function( asserts ) {
|
expect: function( asserts ) {
|
||||||
config.current.expected = asserts;
|
if (arguments.length === 1) {
|
||||||
|
config.current.expected = asserts;
|
||||||
|
} else {
|
||||||
|
return config.current.expected;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
start: function( count ) {
|
start: function( count ) {
|
||||||
@@ -415,6 +422,8 @@ QUnit.assert = {
|
|||||||
|
|
||||||
var source,
|
var source,
|
||||||
details = {
|
details = {
|
||||||
|
module: config.current.module,
|
||||||
|
name: config.current.testName,
|
||||||
result: result,
|
result: result,
|
||||||
message: msg
|
message: msg
|
||||||
};
|
};
|
||||||
@@ -600,6 +609,9 @@ config = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// Set of all modules.
|
||||||
|
modules: {},
|
||||||
|
|
||||||
// logging callback queues
|
// logging callback queues
|
||||||
begin: [],
|
begin: [],
|
||||||
done: [],
|
done: [],
|
||||||
@@ -710,17 +722,10 @@ extend( QUnit, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Resets the test setup. Useful for tests that modify the DOM.
|
// Resets the test setup. Useful for tests that modify the DOM.
|
||||||
// If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
|
|
||||||
reset: function() {
|
reset: function() {
|
||||||
var fixture;
|
var fixture = id( "qunit-fixture" );
|
||||||
|
if ( fixture ) {
|
||||||
if ( window.jQuery ) {
|
fixture.innerHTML = config.fixture;
|
||||||
jQuery( "#qunit-fixture" ).html( config.fixture );
|
|
||||||
} else {
|
|
||||||
fixture = id( "qunit-fixture" );
|
|
||||||
if ( fixture ) {
|
|
||||||
fixture.innerHTML = config.fixture;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -781,6 +786,8 @@ extend( QUnit, {
|
|||||||
|
|
||||||
var output, source,
|
var output, source,
|
||||||
details = {
|
details = {
|
||||||
|
module: config.current.module,
|
||||||
|
name: config.current.testName,
|
||||||
result: result,
|
result: result,
|
||||||
message: message,
|
message: message,
|
||||||
actual: actual,
|
actual: actual,
|
||||||
@@ -826,6 +833,8 @@ extend( QUnit, {
|
|||||||
|
|
||||||
var output,
|
var output,
|
||||||
details = {
|
details = {
|
||||||
|
module: config.current.module,
|
||||||
|
name: config.current.testName,
|
||||||
result: false,
|
result: false,
|
||||||
message: message
|
message: message
|
||||||
};
|
};
|
||||||
@@ -916,7 +925,9 @@ QUnit.load = function() {
|
|||||||
runLoggingCallbacks( "begin", QUnit, {} );
|
runLoggingCallbacks( "begin", QUnit, {} );
|
||||||
|
|
||||||
// Initialize the config, saving the execution queue
|
// Initialize the config, saving the execution queue
|
||||||
var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes,
|
var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter,
|
||||||
|
numModules = 0,
|
||||||
|
moduleFilterHtml = "",
|
||||||
urlConfigHtml = "",
|
urlConfigHtml = "",
|
||||||
oldconfig = extend( {}, config );
|
oldconfig = extend( {}, config );
|
||||||
|
|
||||||
@@ -940,6 +951,15 @@ QUnit.load = function() {
|
|||||||
urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>";
|
urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " + ( config.module === undefined ? "selected" : "" ) + ">< All Modules ></option>";
|
||||||
|
for ( i in config.modules ) {
|
||||||
|
if ( config.modules.hasOwnProperty( i ) ) {
|
||||||
|
numModules += 1;
|
||||||
|
moduleFilterHtml += "<option value='" + encodeURIComponent(i) + "' " + ( config.module === i ? "selected" : "" ) + ">" + i + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moduleFilterHtml += "</select>";
|
||||||
|
|
||||||
// `userAgent` initialized at top of scope
|
// `userAgent` initialized at top of scope
|
||||||
userAgent = id( "qunit-userAgent" );
|
userAgent = id( "qunit-userAgent" );
|
||||||
if ( userAgent ) {
|
if ( userAgent ) {
|
||||||
@@ -1002,6 +1022,19 @@ QUnit.load = function() {
|
|||||||
window.location = QUnit.url( params );
|
window.location = QUnit.url( params );
|
||||||
});
|
});
|
||||||
toolbar.appendChild( urlConfigCheckboxes );
|
toolbar.appendChild( urlConfigCheckboxes );
|
||||||
|
|
||||||
|
if (numModules > 1) {
|
||||||
|
moduleFilter = document.createElement( 'span' );
|
||||||
|
moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' );
|
||||||
|
moduleFilter.innerHTML = moduleFilterHtml;
|
||||||
|
addEvent( moduleFilter, "change", function() {
|
||||||
|
var selectBox = moduleFilter.getElementsByTagName("select")[0],
|
||||||
|
selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value);
|
||||||
|
|
||||||
|
window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } );
|
||||||
|
});
|
||||||
|
toolbar.appendChild(moduleFilter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// `main` initialized at top of scope
|
// `main` initialized at top of scope
|
||||||
@@ -1039,9 +1072,9 @@ window.onerror = function ( error, filePath, linerNr ) {
|
|||||||
}
|
}
|
||||||
QUnit.pushFailure( error, filePath + ":" + linerNr );
|
QUnit.pushFailure( error, filePath + ":" + linerNr );
|
||||||
} else {
|
} else {
|
||||||
QUnit.test( "global failure", function() {
|
QUnit.test( "global failure", extend( function() {
|
||||||
QUnit.pushFailure( error, filePath + ":" + linerNr );
|
QUnit.pushFailure( error, filePath + ":" + linerNr );
|
||||||
});
|
}, { validTest: validTest } ) );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1108,6 +1141,11 @@ function done() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// scroll back to top to show results
|
||||||
|
if ( window.scrollTo ) {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
runLoggingCallbacks( "done", QUnit, {
|
runLoggingCallbacks( "done", QUnit, {
|
||||||
failed: config.stats.bad,
|
failed: config.stats.bad,
|
||||||
passed: passed,
|
passed: passed,
|
||||||
@@ -1123,6 +1161,12 @@ function validTest( test ) {
|
|||||||
module = config.module && config.module.toLowerCase(),
|
module = config.module && config.module.toLowerCase(),
|
||||||
fullName = (test.module + ": " + test.testName).toLowerCase();
|
fullName = (test.module + ": " + test.testName).toLowerCase();
|
||||||
|
|
||||||
|
// Internally-generated tests are always valid
|
||||||
|
if ( test.callback && test.callback.validTest === validTest ) {
|
||||||
|
delete test.callback.validTest;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if ( config.testNumber ) {
|
if ( config.testNumber ) {
|
||||||
return test.testNumber === config.testNumber;
|
return test.testNumber === config.testNumber;
|
||||||
}
|
}
|
||||||
@@ -1404,7 +1448,8 @@ QUnit.equiv = (function() {
|
|||||||
a.global === b.global &&
|
a.global === b.global &&
|
||||||
// (gmi) ...
|
// (gmi) ...
|
||||||
a.ignoreCase === b.ignoreCase &&
|
a.ignoreCase === b.ignoreCase &&
|
||||||
a.multiline === b.multiline;
|
a.multiline === b.multiline &&
|
||||||
|
a.sticky === b.sticky;
|
||||||
},
|
},
|
||||||
|
|
||||||
// - skip when the property is a method of an instance (OOP)
|
// - skip when the property is a method of an instance (OOP)
|
||||||
|
|||||||
91
vendor/requirejs/require.js
vendored
91
vendor/requirejs/require.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/** vim: et:ts=4:sw=4:sts=4
|
/** vim: et:ts=4:sw=4:sts=4
|
||||||
* @license RequireJS 2.1.0 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
* @license RequireJS 2.1.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||||
* Available via the MIT or new BSD license.
|
* Available via the MIT or new BSD license.
|
||||||
* see: http://github.com/jrburke/requirejs for details
|
* see: http://github.com/jrburke/requirejs for details
|
||||||
*/
|
*/
|
||||||
@@ -12,7 +12,7 @@ var requirejs, require, define;
|
|||||||
(function (global) {
|
(function (global) {
|
||||||
var req, s, head, baseElement, dataMain, src,
|
var req, s, head, baseElement, dataMain, src,
|
||||||
interactiveScript, currentlyAddingScript, mainScript, subPath,
|
interactiveScript, currentlyAddingScript, mainScript, subPath,
|
||||||
version = '2.1.0',
|
version = '2.1.1',
|
||||||
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
||||||
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||||
jsSuffixRegExp = /\.js$/,
|
jsSuffixRegExp = /\.js$/,
|
||||||
@@ -100,9 +100,6 @@ var requirejs, require, define;
|
|||||||
/**
|
/**
|
||||||
* Simple function to mix in properties from source into target,
|
* Simple function to mix in properties from source into target,
|
||||||
* but only if target does not already have a property of the same name.
|
* but only if target does not already have a property of the same name.
|
||||||
* This is not robust in IE for transferring methods that match
|
|
||||||
* Object.prototype names, but the uses of mixin here seem unlikely to
|
|
||||||
* trigger a problem related to that.
|
|
||||||
*/
|
*/
|
||||||
function mixin(target, source, force, deepStringMixin) {
|
function mixin(target, source, force, deepStringMixin) {
|
||||||
if (source) {
|
if (source) {
|
||||||
@@ -195,7 +192,9 @@ var requirejs, require, define;
|
|||||||
baseUrl: './',
|
baseUrl: './',
|
||||||
paths: {},
|
paths: {},
|
||||||
pkgs: {},
|
pkgs: {},
|
||||||
shim: {}
|
shim: {},
|
||||||
|
map: {},
|
||||||
|
config: {}
|
||||||
},
|
},
|
||||||
registry = {},
|
registry = {},
|
||||||
undefEvents = {},
|
undefEvents = {},
|
||||||
@@ -1167,6 +1166,25 @@ var requirejs, require, define;
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function intakeDefines() {
|
||||||
|
var args;
|
||||||
|
|
||||||
|
//Any defined modules in the global queue, intake them now.
|
||||||
|
takeGlobalQueue();
|
||||||
|
|
||||||
|
//Make sure any remaining defQueue items get properly processed.
|
||||||
|
while (defQueue.length) {
|
||||||
|
args = defQueue.shift();
|
||||||
|
if (args[0] === null) {
|
||||||
|
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
|
||||||
|
} else {
|
||||||
|
//args are id, deps, factory. Should be normalized by the
|
||||||
|
//define() function.
|
||||||
|
callGetModule(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
config: config,
|
config: config,
|
||||||
contextName: contextName,
|
contextName: contextName,
|
||||||
@@ -1194,20 +1212,23 @@ var requirejs, require, define;
|
|||||||
//they are additive.
|
//they are additive.
|
||||||
var pkgs = config.pkgs,
|
var pkgs = config.pkgs,
|
||||||
shim = config.shim,
|
shim = config.shim,
|
||||||
paths = config.paths,
|
objs = {
|
||||||
map = config.map;
|
paths: true,
|
||||||
|
config: true,
|
||||||
|
map: true
|
||||||
|
};
|
||||||
|
|
||||||
//Mix in the config values, favoring the new values over
|
eachProp(cfg, function (value, prop) {
|
||||||
//existing ones in context.config.
|
if (objs[prop]) {
|
||||||
mixin(config, cfg, true);
|
if (prop === 'map') {
|
||||||
|
mixin(config[prop], value, true, true);
|
||||||
//Merge paths.
|
} else {
|
||||||
config.paths = mixin(paths, cfg.paths, true);
|
mixin(config[prop], value, true);
|
||||||
|
}
|
||||||
//Merge map
|
} else {
|
||||||
if (cfg.map) {
|
config[prop] = value;
|
||||||
config.map = mixin(map || {}, cfg.map, true, true);
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
//Merge shim
|
//Merge shim
|
||||||
if (cfg.shim) {
|
if (cfg.shim) {
|
||||||
@@ -1288,8 +1309,8 @@ var requirejs, require, define;
|
|||||||
makeRequire: function (relMap, options) {
|
makeRequire: function (relMap, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
function require(deps, callback, errback) {
|
function localRequire(deps, callback, errback) {
|
||||||
var id, map, requireMod, args;
|
var id, map, requireMod;
|
||||||
|
|
||||||
if (options.enableBuildCallback && callback && isFunction(callback)) {
|
if (options.enableBuildCallback && callback && isFunction(callback)) {
|
||||||
callback.__requireJsBuild = true;
|
callback.__requireJsBuild = true;
|
||||||
@@ -1328,23 +1349,15 @@ var requirejs, require, define;
|
|||||||
return defined[id];
|
return defined[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Any defined modules in the global queue, intake them now.
|
//Grab defines waiting in the global queue.
|
||||||
takeGlobalQueue();
|
intakeDefines();
|
||||||
|
|
||||||
//Make sure any remaining defQueue items get properly processed.
|
|
||||||
while (defQueue.length) {
|
|
||||||
args = defQueue.shift();
|
|
||||||
if (args[0] === null) {
|
|
||||||
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
|
|
||||||
} else {
|
|
||||||
//args are id, deps, factory. Should be normalized by the
|
|
||||||
//define() function.
|
|
||||||
callGetModule(args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Mark all the dependencies as needing to be loaded.
|
//Mark all the dependencies as needing to be loaded.
|
||||||
context.nextTick(function () {
|
context.nextTick(function () {
|
||||||
|
//Some defines could have been added since the
|
||||||
|
//require call, collect them.
|
||||||
|
intakeDefines();
|
||||||
|
|
||||||
requireMod = getModule(makeModuleMap(null, relMap));
|
requireMod = getModule(makeModuleMap(null, relMap));
|
||||||
|
|
||||||
//Store if map config should be applied to this require
|
//Store if map config should be applied to this require
|
||||||
@@ -1358,10 +1371,10 @@ var requirejs, require, define;
|
|||||||
checkLoaded();
|
checkLoaded();
|
||||||
});
|
});
|
||||||
|
|
||||||
return require;
|
return localRequire;
|
||||||
}
|
}
|
||||||
|
|
||||||
mixin(require, {
|
mixin(localRequire, {
|
||||||
isBrowser: isBrowser,
|
isBrowser: isBrowser,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1394,7 +1407,7 @@ var requirejs, require, define;
|
|||||||
|
|
||||||
//Only allow undef on top level require calls
|
//Only allow undef on top level require calls
|
||||||
if (!relMap) {
|
if (!relMap) {
|
||||||
require.undef = function (id) {
|
localRequire.undef = function (id) {
|
||||||
//Bind any waiting define() calls to this context,
|
//Bind any waiting define() calls to this context,
|
||||||
//fix for #408
|
//fix for #408
|
||||||
takeGlobalQueue();
|
takeGlobalQueue();
|
||||||
@@ -1419,7 +1432,7 @@ var requirejs, require, define;
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return require;
|
return localRequire;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user