;(function(window, undefined) { 'use strict'; /** Use a single "load" function */ var load = typeof require == 'function' ? require : window.load; /** The file path of the Lo-Dash file to test */ var filePath = (function() { var min = 0; var result = window.phantom ? phantom.args : (window.system ? (min = 1, system.args) : (window.process ? (min = 2, process.argv) : (window.arguments || [])) ); var last = result[result.length - 1]; result = (result.length > min && last != 'test.js') ? last : '../lodash.js'; try { return require('fs').realpathSync(result); } catch(e) { return result; } }()); /** The basename of the Lo-Dash file to test */ var basename = /[\w.-]+$/.exec(filePath)[0]; /** The `platform` object to check */ var platform = window.platform || load('../vendor/platform.js/platform.js') || window.platform; /** The unit testing framework */ var QUnit = (function() { var noop = Function.prototype; return window.QUnit || ( window.addEventListener || (window.addEventListener = noop), window.setTimeout || (window.setTimeout = noop), window.QUnit = load('../vendor/qunit/qunit/qunit.js') || window.QUnit, (load('../vendor/qunit-clib/qunit-clib.js') || { 'runInContext': noop }).runInContext(window), addEventListener === noop && delete window.addEventListener, window.QUnit ); }()); /** The `lodash` function to test */ var _ = window._ || ( _ = load(filePath) || window._, _._ || _ ); _ = _.runInContext(window); /** Used to pass falsey values to methods */ var falsey = [ , '', 0, false, NaN, null, undefined ]; /** Shortcut used to make object properties immutable */ var freeze = Object.freeze; /** Used to set property descriptors */ var setDescriptor = (function() { try { var o = {}, fn = (fn = Object.defineProperty)(o, o, o) && fn; } catch(e) { } return fn; }()); /** Shortcut used to convert array-like objects to arrays */ var slice = Array.prototype.slice; /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */ var shadowed = { 'constructor': 1, 'hasOwnProperty': 2, 'isPrototypeOf': 3, 'propertyIsEnumerable': 4, 'toLocaleString': 5, 'toString': 6, 'valueOf': 7 }; /** Used to check problem JScript properties too */ var shadowedKeys = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /*--------------------------------------------------------------------------*/ /** * Skips a given number of tests with a passing result. * * @private * @param {Number} [count=1] The number of tests to skip. */ function skipTest(count) { count || (count = 1); while (count--) { ok(true, 'test skipped'); } } /*--------------------------------------------------------------------------*/ // add object from iframe (function() { if (!window.document || window.phantom) { return; } var body = document.body, iframe = document.createElement('iframe'); iframe.frameBorder = iframe.height = iframe.width = 0; body.appendChild(iframe); var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc; idoc.write("