Skip to content

Commit 98a9949

Browse files
committed
snapshot
1 parent 8e23461 commit 98a9949

File tree

1 file changed

+94
-27
lines changed

1 file changed

+94
-27
lines changed

dist/r.js

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 2.1.22+ Tue, 15 Mar 2016 23:27:47 GMT Copyright jQuery Foundation and other contributors.
2+
* @license r.js 2.1.22+ Thu, 17 Mar 2016 00:36:23 GMT Copyright jQuery Foundation and other contributors.
33
* Released under MIT license, http://github.com/requirejs/r.js/LICENSE
44
*/
55

@@ -19,7 +19,7 @@ var requirejs, require, define, xpcUtil;
1919
(function (console, args, readFileFunc) {
2020
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2121
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
22-
version = '2.1.22+ Tue, 15 Mar 2016 23:27:47 GMT',
22+
version = '2.1.22+ Thu, 17 Mar 2016 00:36:23 GMT',
2323
jsSuffixRegExp = /\.js$/,
2424
commandOption = '',
2525
useLibLoaded = {},
@@ -5598,6 +5598,7 @@ define('logger', ['env!env/print'], function (print) {
55985598
}
55995599

56005600
if (quote !== '') {
5601+
index = start;
56015602
throwUnexpectedToken();
56025603
}
56035604

@@ -7190,7 +7191,7 @@ define('logger', ['env!env/print'], function (print) {
71907191

71917192
return node.finishProperty(
71927193
'init', key, false,
7193-
new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false);
7194+
new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, true);
71947195
} else if (!match(':')) {
71957196
params.push(keyToken);
71967197
return node.finishProperty('init', key, false, key, false, true);
@@ -7725,6 +7726,9 @@ define('logger', ['env!env/print'], function (print) {
77257726
if (!strict && state.allowYield && matchKeyword('yield')) {
77267727
return parseNonComputedProperty();
77277728
}
7729+
if (!strict && matchKeyword('let')) {
7730+
return node.finishIdentifier(lex().value);
7731+
}
77287732
isAssignmentTarget = isBindingElement = false;
77297733
if (matchKeyword('function')) {
77307734
return parseFunctionExpression();
@@ -7736,9 +7740,6 @@ define('logger', ['env!env/print'], function (print) {
77367740
if (matchKeyword('class')) {
77377741
return parseClassExpression();
77387742
}
7739-
if (!strict && matchKeyword('let')) {
7740-
return node.finishIdentifier(lex().value);
7741-
}
77427743
throwUnexpectedToken(lex());
77437744
} else if (type === Token.BooleanLiteral) {
77447745
isAssignmentTarget = isBindingElement = false;
@@ -8316,6 +8317,7 @@ define('logger', ['env!env/print'], function (print) {
83168317

83178318
argument = null;
83188319
expr = new Node();
8320+
delegate = false;
83198321

83208322
expectKeyword('yield');
83218323

@@ -8521,15 +8523,15 @@ define('logger', ['env!env/print'], function (print) {
85218523
}
85228524

85238525
function parseVariableDeclarationList(options) {
8524-
var list = [];
8526+
var opt, list;
85258527

8526-
do {
8527-
list.push(parseVariableDeclaration({ inFor: options.inFor }));
8528-
if (!match(',')) {
8529-
break;
8530-
}
8528+
opt = { inFor: options.inFor };
8529+
list = [parseVariableDeclaration(opt)];
8530+
8531+
while (match(',')) {
85318532
lex();
8532-
} while (startIndex < length);
8533+
list.push(parseVariableDeclaration(opt));
8534+
}
85338535

85348536
return list;
85358537
}
@@ -8572,15 +8574,12 @@ define('logger', ['env!env/print'], function (print) {
85728574
}
85738575

85748576
function parseBindingList(kind, options) {
8575-
var list = [];
8577+
var list = [parseLexicalBinding(kind, options)];
85768578

8577-
do {
8578-
list.push(parseLexicalBinding(kind, options));
8579-
if (!match(',')) {
8580-
break;
8581-
}
8579+
while (match(',')) {
85828580
lex();
8583-
} while (startIndex < length);
8581+
list.push(parseLexicalBinding(kind, options));
8582+
}
85848583

85858584
return list;
85868585
}
@@ -9284,7 +9283,7 @@ define('logger', ['env!env/print'], function (print) {
92849283

92859284
function parseFunctionSourceElements() {
92869285
var statement, body = [], token, directive, firstRestricted,
9287-
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
9286+
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody,
92889287
node = new Node();
92899288

92909289
expect('{');
@@ -9318,13 +9317,11 @@ define('logger', ['env!env/print'], function (print) {
93189317
oldInIteration = state.inIteration;
93199318
oldInSwitch = state.inSwitch;
93209319
oldInFunctionBody = state.inFunctionBody;
9321-
oldParenthesisCount = state.parenthesizedCount;
93229320

93239321
state.labelSet = {};
93249322
state.inIteration = false;
93259323
state.inSwitch = false;
93269324
state.inFunctionBody = true;
9327-
state.parenthesizedCount = 0;
93289325

93299326
while (startIndex < length) {
93309327
if (match('}')) {
@@ -9339,7 +9336,6 @@ define('logger', ['env!env/print'], function (print) {
93399336
state.inIteration = oldInIteration;
93409337
state.inSwitch = oldInSwitch;
93419338
state.inFunctionBody = oldInFunctionBody;
9342-
state.parenthesizedCount = oldParenthesisCount;
93439339

93449340
return node.finishBlockStatement(body);
93459341
}
@@ -10173,7 +10169,7 @@ define('logger', ['env!env/print'], function (print) {
1017310169
}
1017410170

1017510171
// Sync with *.json manifests.
10176-
exports.version = '2.7.0';
10172+
exports.version = '2.7.2';
1017710173

1017810174
exports.tokenize = tokenize;
1017910175

@@ -22480,6 +22476,33 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2248022476
return name;
2248122477
};
2248222478

22479+
/**
22480+
* Finds all the named define module IDs in a file.
22481+
*/
22482+
parse.getAllNamedDefines = function (fileContents, excludeMap) {
22483+
var names = [];
22484+
parse.recurse(esprima.parse(fileContents),
22485+
function (callName, config, name, deps, node, factoryIdentifier, fnExpScope) {
22486+
if (callName === 'define' && name) {
22487+
if (!excludeMap.hasOwnProperty(name)) {
22488+
names.push(name);
22489+
}
22490+
}
22491+
22492+
//If a UMD definition that points to a factory that is an Identifier,
22493+
//indicate processing should not traverse inside the UMD definition.
22494+
if (callName === 'define' && factoryIdentifier && hasProp(fnExpScope, factoryIdentifier)) {
22495+
return factoryIdentifier;
22496+
}
22497+
22498+
//If define was found, no need to dive deeper, unless
22499+
//the config explicitly wants to dig deeper.
22500+
return true;
22501+
}, {});
22502+
22503+
return names;
22504+
};
22505+
2248322506
/**
2248422507
* Determines if define(), require({}|[]) or requirejs was called in the
2248522508
* file. Also finds out if define() is declared and if define.amd is called.
@@ -25408,17 +25431,36 @@ define('build', function (require) {
2540825431
}));
2540925432
}
2541025433
}).then(function () {
25411-
var moduleName, outOrigSourceMap;
25434+
var moduleName, outOrigSourceMap,
25435+
bundlesConfig = {},
25436+
bundlesConfigOutFile = config.bundlesConfigOutFile;
25437+
2541225438
if (modules) {
2541325439
//Now move the build layers to their final position.
2541425440
modules.forEach(function (module) {
25415-
var finalPath = module._buildPath;
25441+
var entryConfig,
25442+
finalPath = module._buildPath;
25443+
2541625444
if (finalPath !== 'FUNCTION') {
2541725445
if (file.exists(finalPath)) {
2541825446
file.deleteFile(finalPath);
2541925447
}
2542025448
file.renameFile(finalPath + '-temp', finalPath);
2542125449

25450+
//If bundles config should be written out, scan the
25451+
//built file for module IDs. Favor doing this reparse
25452+
//since tracking the IDs as the file is built has some
25453+
//edge cases around files that had more than one ID in
25454+
//them already, and likely loader plugin-written contents.
25455+
if (bundlesConfigOutFile) {
25456+
entryConfig = bundlesConfig[module.name] = [];
25457+
var bundleContents = file.readFile(finalPath);
25458+
var excludeMap = {};
25459+
excludeMap[module.name] = true;
25460+
var parsedIds = parse.getAllNamedDefines(bundleContents, excludeMap);
25461+
entryConfig.push.apply(entryConfig, parsedIds);
25462+
}
25463+
2542225464
//And finally, if removeCombined is specified, remove
2542325465
//any of the files that were used in this layer.
2542425466
//Be sure not to remove other build layers.
@@ -25445,6 +25487,24 @@ define('build', function (require) {
2544525487
config.onModuleBundleComplete(module.onCompleteData);
2544625488
}
2544725489
});
25490+
25491+
//Write out bundles config, if it is wanted.
25492+
if (bundlesConfigOutFile) {
25493+
var text = file.readFile(bundlesConfigOutFile);
25494+
text = transform.modifyConfig(text, function (config) {
25495+
if (!config.bundles) {
25496+
config.bundles = {};
25497+
}
25498+
25499+
lang.eachProp(bundlesConfig, function (value, prop) {
25500+
config.bundles[prop] = value;
25501+
});
25502+
25503+
return config;
25504+
});
25505+
25506+
file.saveUtf8File(bundlesConfigOutFile, text);
25507+
}
2544825508
}
2544925509

2545025510
//If removeCombined in play, remove any empty directories that
@@ -26131,6 +26191,13 @@ define('build', function (require) {
2613126191
config.dirBaseUrl = endsWithSlash(config.dirBaseUrl);
2613226192
}
2613326193

26194+
if (config.bundlesConfigOutFile) {
26195+
if (!config.dir) {
26196+
throw new Error('bundlesConfigOutFile can only be used with optimizations ' +
26197+
'that use "dir".');
26198+
}
26199+
config.bundlesConfigOutFile = build.makeAbsPath(config.bundlesConfigOutFile, config.dir);
26200+
}
2613426201

2613526202
//If out=stdout, write output to STDOUT instead of a file.
2613626203
if (config.out && config.out === 'stdout') {

0 commit comments

Comments
 (0)