Rename useNativeBind and useNativeKeys to isBindFast and isKeysFast.

Former-commit-id: 9f001b030dc49146b177678443406720c436ac0b
This commit is contained in:
John-David Dalton
2012-07-08 02:40:39 -04:00
parent 04d4353c0f
commit 83e3f830e6
2 changed files with 7 additions and 7 deletions

View File

@@ -57,14 +57,14 @@
'hasDontEnumBug', 'hasDontEnumBug',
'inLoop', 'inLoop',
'init', 'init',
'isKeysFast',
'iteratedObject', 'iteratedObject',
'loopExp', 'loopExp',
'object', 'object',
'objectBranch', 'objectBranch',
'shadowed', 'shadowed',
'top', 'top',
'useHas', 'useHas'
'useNativeKeys'
]; ];
/** Used to minify variables and string values to a single character */ /** Used to minify variables and string values to a single character */

View File

@@ -129,10 +129,10 @@
var hasDontEnumBug = !propertyIsEnumerable.call({ 'valueOf': 0 }, 'valueOf'); var hasDontEnumBug = !propertyIsEnumerable.call({ 'valueOf': 0 }, 'valueOf');
/* Detect if `Function#bind` exists and is inferred to be fast (i.e. all but V8) */ /* Detect if `Function#bind` exists and is inferred to be fast (i.e. all but V8) */
var useNativeBind = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera)); var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera));
/* Detect if `Object.keys` exists and is inferred to be fast (i.e. V8, Opera, IE) */ /* Detect if `Object.keys` exists and is inferred to be fast (i.e. V8, Opera, IE) */
var useNativeKeys = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent); var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent);
/** Detect if sourceURL syntax is usable without erroring */ /** Detect if sourceURL syntax is usable without erroring */
try { try {
@@ -289,7 +289,7 @@
' <%= objectBranch.beforeLoop %>;\n<%' + ' <%= objectBranch.beforeLoop %>;\n<%' +
// iterate own properties using `Object.keys` if it's fast // iterate own properties using `Object.keys` if it's fast
' if (useNativeKeys && useHas) { %>' + ' if (isKeysFast && useHas) { %>' +
' var props = nativeKeys(<%= iteratedObject %>),\n' + ' var props = nativeKeys(<%= iteratedObject %>),\n' +
' propIndex = -1,\n' + ' propIndex = -1,\n' +
' length = props.length;\n' + ' length = props.length;\n' +
@@ -500,8 +500,8 @@
data.firstArg = firstArg; data.firstArg = firstArg;
data.hasDontEnumBug = hasDontEnumBug; data.hasDontEnumBug = hasDontEnumBug;
data.useNativeKeys = useNativeKeys;
data.hasExp = 'hasOwnProperty.call(' + iteratedObject + ', index)'; data.hasExp = 'hasOwnProperty.call(' + iteratedObject + ', index)';
data.isKeysFast = isKeysFast;
data.iteratedObject = iteratedObject; data.iteratedObject = iteratedObject;
data.shadowed = shadowed; data.shadowed = shadowed;
data.useHas = data.useHas !== false; data.useHas = data.useHas !== false;
@@ -1981,7 +1981,7 @@
} }
// use `Function#bind` if it exists and is fast // use `Function#bind` if it exists and is fast
// (in V8 `Function#bind` is slower except when partially applied) // (in V8 `Function#bind` is slower except when partially applied)
else if (useNativeBind || (nativeBind && arguments.length > 2)) { else if (isBindFast || (nativeBind && arguments.length > 2)) {
return nativeBind.call.apply(nativeBind, arguments); return nativeBind.call.apply(nativeBind, arguments);
} }