mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Ensure reThis isn't used in Windows 8 apps.
This commit is contained in:
16
lodash.js
16
lodash.js
@@ -69,7 +69,7 @@
|
||||
var reNoMatch = /($^)/;
|
||||
|
||||
/** Used to detect functions containing a `this` reference */
|
||||
var reThis = (reThis = /\bthis\b/) && reThis.test(runInContext) && reThis;
|
||||
var reThis = /\bthis\b/;
|
||||
|
||||
/** Used to match unescaped characters in compiled string literals */
|
||||
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
|
||||
@@ -716,6 +716,14 @@
|
||||
*/
|
||||
support.fastBind = nativeBind && !isV8;
|
||||
|
||||
/**
|
||||
* Detect if functions can be decompiled by `Function#toString`
|
||||
* (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type boolean
|
||||
*/
|
||||
support.funcDecomp = !reNative.test(context.WinRTError) && reThis.test(runInContext);
|
||||
|
||||
/**
|
||||
* Detect if `Function#name` is supported (all but IE).
|
||||
@@ -1089,7 +1097,7 @@
|
||||
}
|
||||
if (support.funcNames || !bindData) {
|
||||
// checks if `func` references the `this` keyword and stores the result
|
||||
bindData = !reThis || reThis.test(source);
|
||||
bindData = !support.funcDecomp || reThis.test(source);
|
||||
setBindData(func, bindData);
|
||||
}
|
||||
}
|
||||
@@ -6195,7 +6203,7 @@
|
||||
if (data) {
|
||||
return result(data);
|
||||
}
|
||||
// provide the compiled function's source via its `toString` method, in
|
||||
// provide the compiled function's source by its `toString` method, in
|
||||
// supported environments, or the `source` property as a convenience for
|
||||
// inlining compiled templates during the build process
|
||||
result.source = source;
|
||||
@@ -6659,7 +6667,7 @@
|
||||
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
||||
// case Lo-Dash was injected by a third-party script and not intended to be
|
||||
// loaded as a module. The global assignment can be reverted in the Lo-Dash
|
||||
// module via its `noConflict()` method.
|
||||
// module by its `noConflict()` method.
|
||||
root._ = _;
|
||||
|
||||
// define as an anonymous module so, through path mapping, it can be
|
||||
|
||||
Reference in New Issue
Block a user