8000 Update vendor folder. · lodash/lodash@db25777 · GitHub
[go: up one dir, main page]

Skip to content

Commit db25777

Browse files
committed
Update vendor folder.
Former-commit-id: dde7c53eee254e2f50608e65540893764ab8d9cb
1 parent 3b37d74 commit db25777

File tree

6 files changed

+104
-66
lines changed

6 files changed

+104
-66
lines changed

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ _.isNumber(8.4 * 5;
13491349
### <a id="_isobjectvalue"></a>`_.isObject(value)`
13501350
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.2/lodash.js#L2873 "View in source") [&#x24C9;][1]
13511351

1352-
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)*`, and `new String('')`)
1352+
Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)`, and `new String('')`)*
13531353

13541354
#### Arguments
13551355
1. `value` *(Mixed)*: The value to check.

vendor/benchmark.js/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1919
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
2020
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2121
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vendor/benchmark.js/README.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,6 @@ suite.add('RegExp#test', function() {
114114
// > Fastest is String#indexOf
115115
~~~
116116

117-
## Cloning this repo
118-
119-
To clone this repository including all submodules, using Git 1.6.5 or later:
120-
121-
~~~ bash
122-
git clone --recursive https://github.com/bestiejs/benchmark.js.git
123-
cd benchmark.js
124-
~~~
125-
126-
For older Git versions, just use:
127-
128-
~~~ bash
129-
git clone https://github.com/bestiejs/benchmark.js.git
130-
cd benchmark.js
131-
git submodule update --init
132-
~~~
133-
134-
Feel free to fork and send pull requests if you see improvements!
135-
136117
## Footnotes
137118

138119
1. Benchmark.js has been tested in at least Adobe AIR 2.6, Chrome 5-15, Firefox 1.5-8, IE 6-10, Opera 9.25-11.52, Safari 2-5.1.1, Node.js 0.4.8-0.6.1, Narwhal 0.3.2, RingoJS 0.7-0.8, and Rhino 1.7RC3.

vendor/benchmark.js/benchmark.js

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
/** Used to check if an object is extensible */
3838
var isExtensible = Object.isExtensible || function() { return true; };
3939

40+
/** Used to access Wade Simmons' Node microtime module */
41+
var microtimeObject = req('microtime');
42+
4043
/** Used to access the browser's high resolution timer */
4144
var perfObject = isHostType(window, 'performance') && performance;
4245

@@ -46,6 +49,9 @@
4649
perfObject.webkitNow && 'webkitNow'
4750
);
4851

52+
/** Used to access Node's high resolution timer */
53+
var processObject = isHostType(window, 'process') && process;
54+
4955
/** Used to check if an own property is enumerable */
5056
var propertyIsEnumerable = {}.propertyIsEnumerable;
5157

@@ -678,7 +684,14 @@
678684

679685
start = toInteger(start);
680686
start = start < 0 ? max(length + start, 0) : min(start, length);
681-
deleteCount = min(max(toInteger(deleteCount), 0), length - start);
687+
688+
// support the de-facto SpiderMonkey extension
689+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice#Parameters
690+
// https://bugs.ecmascript.org/show_bug.cgi?id=429
691+
deleteCount = arguments.length == 1
692+
? length - start
693+
: min(max(toInteger(deleteCount), 0), length - start);
694+
682695
return insert.call(object, start, deleteCount, slice.call(arguments, 2));
683696
}
684697

@@ -1884,6 +1897,21 @@
18841897
* 'onCycle': onCycle,
18851898
* 'onComplete': onComplete
18861899
* });
1900+
*
1901+
* // or name and options
1902+
* suite.add('foo', {
1903+
* 'fn': fn,
1904+
* 'onCycle': onCycle,
1905+
* 'onComplete': onComplete
1906+
* });
1907+
*
1908+
* // or options only
1909+
* suite.add({
1910+
* 'name': 'foo',
1911+
* 'fn': fn,
1912+
* 'onCycle': onCycle,
1913+
* 'onComplete': onComplete
1914+
* });
18871915
*/
18881916
function add(name, fn, options) {
18891917
var me = this,
@@ -2509,7 +2537,7 @@
25092537
if (ns.stop) {
25102538
ns.start();
25112539
while (!(measured = ns.microseconds())) { }
2512-
} else if (perfName) {
2540+
} else if (ns[perfName]) {
25132541
divisor = 1e3;
25142542
measured = Function('n', 'var r,s=n.' + perfName + '();while(!(r=n.' + perfName + '()-s)){};return r')(ns);
25152543
} else {
@@ -2519,8 +2547,14 @@
25192547
}
25202548
else if (unit == 'ns') {
25212549
divisor = 1e9;
2522-
begin = ns.nanoTime();
2523-
while (!(measured = ns.nanoTime() - begin)) { }
2550+
if (ns.nanoTime) {
2551+
begin = ns.nanoTime();
2552+
while (!(measured = ns.nanoTime() - begin)) { }
2553+
} else {
2554+
begin = (begin = ns())[0] + (begin[1] / divisor);
2555+
while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) { }
2556+
divisor = 1;
2557+
}
25242558
}
25252559
else {
25262560
begin = new ns;
@@ -2575,9 +2609,13 @@
25752609
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
25762610
}
25772611

2578-
// detect Node's microtime module:
2579-
// npm install microtime
2580-
if ((timer.ns = (req('microtime') || { 'now': 0 }).now)) {
2612+
// detect Node's nanosecond resolution timer available in Node >= 0.8
2613+
if (processObject && typeof (timer.ns = processObject.hrtime) == 'function') {
2614+
timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' });
2615+
}
2616+
2617+
// detect Wade Simmons' Node microtime module
2618+
if (microtimeObject && typeof (timer.ns = microtimeObject.now) == 'function') {
25812619
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
25822620
}
25832621

@@ -2596,10 +2634,17 @@
25962634
}
25972635
// use API of chosen timer
25982636
if (timer.unit == 'ns') {
2599-
extend(template, {
2600-
'begin': 's$=n$.nanoTime()',
2601-
'end': 'r$=(n$.nanoTime()-s$)/1e9'
2602-
});
2637+
if (timer.ns.nanoTime) {
2638+
extend(template, {
2639+
'begin': 's$=n$.nanoTime()',
2640+
'end': 'r$=(n$.nanoTime()-s$)/1e9'
2641+
});
2642+
} else {
2643+
extend(template, {
2644+
'begin': 's$=n$()',
2645+
'end': 'r$=n$(s$);r$=r$[0]+(r$[1]/1e9)'
2646+
});
2647+
}
26032648
}
26042649
else if (timer.unit == 'us') {
26052650
if (timer.ns.stop) {

vendor/docdown/src/DocDown/Generator.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,28 @@ public function __construct( $source, $options = array() ) {
8787
* @returns {String} The formatted string.
8888
*/
8989
private static function format($string) {
90-
// mark numbers as code and italicize parentheses
91-
return trim(preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*',
92-
preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string)));
90+
$counter = 0;
91+
92+
// tokenize inline code snippets
93+
preg_match_all('/`[^`]+`/', $string, $tokenized);
94+
$tokenized = $tokenized[0];
95+
foreach ($tokenized as $snippet) {
96+
$string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
97+
}
98+
99+
// italicize parentheses
100+
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
101+
102+
// mark numbers as inline code
103+
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
104+
105+
// detokenize inline code snippets
106+
$counter = 0;
107+
foreach ($tokenized as $snippet) {
108+
$string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
109+
}
110+
111+
return trim($string);
93112
}
94113

95114
/**
@@ -388,4 +407,4 @@ function sortCompare($a, $b) {
388407
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
389408
}
390409
}
391-
?>
410+
?>

vendor/requirejs/require.js

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** vim: et:ts=4:sw=4:sts=4
2-
* @license RequireJS 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2+
* @license RequireJS 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
33
* Available via the MIT or new BSD license.
44
* see: http://github.com/jrburke/requirejs for details
55
*/
@@ -10,9 +10,9 @@ var requirejs, require, define;
1010
(function (global) {
1111
'use strict';
1212

13-
var version = '2.0.2',
13+
var version = '2.0.4',
1414
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
15-
cjsRequireRegExp = /require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
15+
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
1616
jsSuffixRegExp = /\.js$/,
1717
currDirRegExp = /^\.\//,
1818
ostring = Object.prototype.toString,
@@ -288,6 +288,7 @@ var requirejs, require, define;
288288
*/
289289
function normalize(name, baseName, applyMap) {
290290
var baseParts = baseName && baseName.split('/'),
291+
normalizedBaseParts = baseParts,
291292
map = config.map,
292293
starMap = map && map['*'],
293294
pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
@@ -302,17 +303,17 @@ var requirejs, require, define;
302303
if (config.pkgs[baseName]) {
303304
//If the baseName is a package name, then just treat it as one
304305
//name to concat the name with.
305-
baseParts = [baseName];
306+
normalizedBaseParts = baseParts = [baseName];
306307
} else {
307308
//Convert baseName to array, and lop off the last part,
308309
//so that . matches that 'directory' and not name of the baseName's
309310
//module. For instance, baseName of 'one/two/three', maps to
310311
//'one/two/three.js', but we want the directory, 'one/two' for
311312
//this normalization.
312-
baseParts = baseParts.slice(0, baseParts.length - 1);
313+
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
313314
}
314315

315-
name = baseParts.concat(name.split('/'));
316+
name = normalizedBaseParts.concat(name.split('/'));
316317
trimDots(name);
317318

318319
//Some use of packages may use a . path to reference the
@@ -450,17 +451,7 @@ var requirejs, require, define;
450451
} else {
451452
//A regular module.
452453
normalizedName = normalize(name, parentName, applyMap);
453-
454-
//Calculate url for the module, if it has a name.
455-
//Use name here since nameToUrl also calls normalize,
456-
//and for relative names that are outside the baseUrl
457-
//this causes havoc. Was thinking of just removing
458-
//parentModuleMap to avoid extra normalization, but
459-
//normalize() still does a dot removal because of
460-
//issue #142, so just pass in name here and redo
461-
//the normalization. Paths outside baseUrl are just
462-
//messy to support.
463-
url = context.nameToUrl(name, null, parentModuleMap);
454+
url = context.nameToUrl(normalizedName);
464455
}
465456
}
466457

@@ -1583,20 +1574,21 @@ var requirejs, require, define;
15831574
moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
15841575
}
15851576

1586-
return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap);
1577+
return context.nameToUrl(normalize(moduleNamePlusExt, relModuleMap && relModuleMap.id, true),
1578+
ext);
15871579
},
15881580

15891581
/**
15901582
* Converts a module name to a file path. Supports cases where
15911583
* moduleName may actually be just an URL.
1584+
* Note that it **does not** call normalize on the moduleName,
1585+
* it is assumed to have already been normalized. This is an
1586+
* internal API, not a public one. Use toUrl for the public API.
15921587
*/
1593-
nameToUrl: function (moduleName, ext, relModuleMap) {
1588+
nameToUrl: function (moduleName, ext) {
15941589
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
15951590
parentPath;
15961591

1597-
//Normalize module name if have a base relative module name to work from.
1598-
moduleName = normalize(moduleName, relModuleMap && relModuleMap.id, true);
1599-
16001592
//If a colon is in the URL, it indicates a protocol is used and it is just
16011593
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
16021594
//or ends with .js, then assume the user meant to use an url and not a module id.
@@ -1822,6 +1814,7 @@ var requirejs, require, define;
18221814
document.createElement('script');
18231815
node.type = config.scriptType || 'text/javascript';
18241816
node.charset = 'utf-8';
1817+
node.async = true;
18251818

18261819
node.setAttribute('data-requirecontext', context.contextName);
18271820
node.setAttribute('data-requiremodule', moduleName);
@@ -1924,21 +1917,21 @@ var requirejs, require, define;
19241917
//baseUrl, if it is not already set.
19251918
dataMain = script.getAttribute('data-main');
19261919
if (dataMain) {
1927-
1928-
//Pull off the directory of data-main for use as the
1929-
//baseUrl.
1930-
src = dataMain.split('/');
1931-
mainScript = src.pop();
1932-
subPath = src.length ? src.join('/') + '/' : './';
1933-
19341920
//Set final baseUrl if there is not already an explicit one.
19351921
if (!cfg.baseUrl) {
1922+
//Pull off the directory of data-main for use as the
1923+
//baseUrl.
1924+
src = dataMain.split('/');
1925+
mainScript = src.pop();
1926+
subPath = src.length ? src.join('/') + '/' : './';
1927+
19361928
cfg.baseUrl = subPath;
1929+
dataMain = mainScript;
19371930
}
19381931

19391932
//Strip off any trailing .js since dataMain is now
19401933
//like a module name.
1941-
dataMain = mainScript.replace(jsSuffixRegExp, '');
1934+
dataMain = dataMain.replace(jsSuffixRegExp, '');
19421935

19431936
//Put the data-main script in the files to load.
19441937
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];

0 commit comments

Comments
 (0)
0