1 line
40 KiB
JSON
1 line
40 KiB
JSON
{"id":"node_modules/chai/lib/chai/utils/overwriteMethod.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/package.json","includedInParent":true,"mtime":1542058764034},{"name":"./addLengthGuard","loc":{"line":7,"column":29},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/addLengthGuard.js"},{"name":"../../chai","loc":{"line":8,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai.js"},{"name":"./flag","loc":{"line":9,"column":19},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/flag.js"},{"name":"./proxify","loc":{"line":10,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/proxify.js"},{"name":"./transferFlags","loc":{"line":11,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/overwriteMethod.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/chai/lib/chai/utils/transferFlags.js"}],"generated":{"js":"/*!\n * Chai - overwriteMethod utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\nvar addLengthGuard = require('./addLengthGuard');\n\nvar chai = require('../../chai');\n\nvar flag = require('./flag');\n\nvar proxify = require('./proxify');\n\nvar transferFlags = require('./transferFlags');\n/**\n * ### .overwriteMethod(ctx, name, fn)\n *\n * Overwrites an already existing method and provides\n * access to previous function. Must return function\n * to be used for name.\n *\n * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {\n * return function (str) {\n * var obj = utils.flag(this, 'object');\n * if (obj instanceof Foo) {\n * new chai.Assertion(obj.value).to.equal(str);\n * } else {\n * _super.apply(this, arguments);\n * }\n * }\n * });\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.overwriteMethod('foo', fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(myFoo).to.equal('bar');\n *\n * @param {Object} ctx object whose method is to be overwritten\n * @param {String} name of method to overwrite\n * @param {Function} method function that returns a function to be used for name\n * @namespace Utils\n * @name overwriteMethod\n * @api public\n */\n\n\nmodule.exports = function overwriteMethod(ctx, name, method) {\n var _method = ctx[name],\n _super = function () {\n throw new Error(name + ' is not a function');\n };\n\n if (_method && 'function' === typeof _method) _super = _method;\n\n var overwritingMethodWrapper = function () {\n // Setting the `ssfi` flag to `overwritingMethodWrapper` causes this\n // function to be the starting point for removing implementation frames from\n // the stack trace of a failed assertion.\n //\n // However, we only want to use this function as the starting point if the\n // `lockSsfi` flag isn't set.\n //\n // If the `lockSsfi` flag is set, then either this assertion has been\n // overwritten by another assertion, or this assertion is being invoked from\n // inside of another assertion. In the first case, the `ssfi` flag has\n // already been set by the overwriting assertion. In the second case, the\n // `ssfi` flag has already been set by the outer assertion.\n if (!flag(this, 'lockSsfi')) {\n flag(this, 'ssfi', overwritingMethodWrapper);\n } // Setting the `lockSsfi` flag to `true` prevents the overwritten assertion\n // from changing the `ssfi` flag. By this point, the `ssfi` flag is already\n // set to the correct starting point for this assertion.\n\n\n var origLockSsfi = flag(this, 'lockSsfi');\n flag(this, 'lockSsfi', true);\n var result = method(_super).apply(this, arguments);\n flag(this, 'lockSsfi', origLockSsfi);\n\n if (result !== undefined) {\n return result;\n }\n\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n };\n\n addLengthGuard(overwritingMethodWrapper, name, false);\n ctx[name] = proxify(overwritingMethodWrapper, name);\n};","map":{"mappings":[{"generated":{"line":1,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":1,"column":0}},{"generated":{"line":6,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":0}},{"name":"addLengthGuard","generated":{"line":6,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":4}},{"generated":{"line":6,"column":18},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":18}},{"name":"require","generated":{"line":6,"column":21},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":21}},{"generated":{"line":6,"column":28},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":28}},{"generated":{"line":6,"column":29},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":29}},{"generated":{"line":6,"column":47},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":28}},{"generated":{"line":6,"column":48},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":7,"column":0}},{"generated":{"line":8,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":0}},{"name":"chai","generated":{"line":8,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":4}},{"generated":{"line":8,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":8}},{"name":"require","generated":{"line":8,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":11}},{"generated":{"line":8,"column":18},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":18}},{"generated":{"line":8,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":19}},{"generated":{"line":8,"column":31},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":18}},{"generated":{"line":8,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":8,"column":0}},{"generated":{"line":10,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":0}},{"name":"flag","generated":{"line":10,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":4}},{"generated":{"line":10,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":8}},{"name":"require","generated":{"line":10,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":11}},{"generated":{"line":10,"column":18},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":18}},{"generated":{"line":10,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":19}},{"generated":{"line":10,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":18}},{"generated":{"line":10,"column":28},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":9,"column":0}},{"generated":{"line":12,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":0}},{"name":"proxify","generated":{"line":12,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":4}},{"generated":{"line":12,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":11}},{"name":"require","generated":{"line":12,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":14}},{"generated":{"line":12,"column":21},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":21}},{"generated":{"line":12,"column":22},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":22}},{"generated":{"line":12,"column":33},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":21}},{"generated":{"line":12,"column":34},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":10,"column":0}},{"generated":{"line":14,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":0}},{"name":"transferFlags","generated":{"line":14,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":4}},{"generated":{"line":14,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":17}},{"name":"require","generated":{"line":14,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":20}},{"generated":{"line":14,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":27}},{"generated":{"line":14,"column":28},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":28}},{"generated":{"line":14,"column":45},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":27}},{"generated":{"line":14,"column":46},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":11,"column":0}},{"generated":{"line":15,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":13,"column":0}},{"name":"module","generated":{"line":50,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":0}},{"generated":{"line":50,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":6}},{"name":"exports","generated":{"line":50,"column":7},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":7}},{"generated":{"line":50,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":0}},{"generated":{"line":50,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":17}},{"name":"overwriteMethod","generated":{"line":50,"column":26},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":26}},{"generated":{"line":50,"column":41},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":17}},{"name":"ctx","generated":{"line":50,"column":42},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":42}},{"generated":{"line":50,"column":45},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":17}},{"name":"name","generated":{"line":50,"column":47},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":47}},{"generated":{"line":50,"column":51},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":17}},{"name":"method","generated":{"line":50,"column":53},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":53}},{"generated":{"line":50,"column":59},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":17}},{"generated":{"line":50,"column":61},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":61}},{"generated":{"line":51,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":2}},{"name":"_method","generated":{"line":51,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":6}},{"generated":{"line":51,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":13}},{"name":"ctx","generated":{"line":51,"column":16},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":16}},{"generated":{"line":51,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":19}},{"name":"name","generated":{"line":51,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":20}},{"generated":{"line":51,"column":24},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":19}},{"generated":{"line":51,"column":25},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":2}},{"generated":{"line":52,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":2}},{"name":"_super","generated":{"line":52,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":49,"column":6}},{"generated":{"line":52,"column":12},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":49,"column":12}},{"generated":{"line":52,"column":15},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":49,"column":15}},{"generated":{"line":52,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":49,"column":27}},{"generated":{"line":53,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":6}},{"generated":{"line":53,"column":10},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":12}},{"name":"Error","generated":{"line":53,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":16}},{"generated":{"line":53,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":12}},{"name":"name","generated":{"line":53,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":22}},{"generated":{"line":53,"column":24},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":26}},{"generated":{"line":53,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":29}},{"generated":{"line":53,"column":47},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":12}},{"generated":{"line":53,"column":48},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":50,"column":6}},{"generated":{"line":54,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":51,"column":5}},{"generated":{"line":54,"column":3},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":48,"column":2}},{"generated":{"line":56,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":2}},{"name":"_method","generated":{"line":56,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":6}},{"generated":{"line":56,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":13}},{"generated":{"line":56,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":17}},{"generated":{"line":56,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":32}},{"name":"_method","generated":{"line":56,"column":39},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":39}},{"generated":{"line":56,"column":46},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":53,"column":2}},{"name":"_super","generated":{"line":56,"column":48},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":54,"column":4}},{"generated":{"line":56,"column":54},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":54,"column":10}},{"name":"_method","generated":{"line":56,"column":57},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":54,"column":13}},{"generated":{"line":56,"column":64},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":54,"column":4}},{"generated":{"line":58,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":2}},{"name":"overwritingMethodWrapper","generated":{"line":58,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":6}},{"generated":{"line":58,"column":30},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":30}},{"generated":{"line":58,"column":33},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":33}},{"generated":{"line":58,"column":45},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":45}},{"generated":{"line":59,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":57,"column":4}},{"generated":{"line":60,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":58,"column":4}},{"generated":{"line":61,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":59,"column":4}},{"generated":{"line":62,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":60,"column":4}},{"generated":{"line":63,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":61,"column":4}},{"generated":{"line":64,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":62,"column":4}},{"generated":{"line":65,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":63,"column":4}},{"generated":{"line":66,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":64,"column":4}},{"generated":{"line":67,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":65,"column":4}},{"generated":{"line":68,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":66,"column":4}},{"generated":{"line":69,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":67,"column":4}},{"generated":{"line":70,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":68,"column":4}},{"generated":{"line":71,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":4}},{"generated":{"line":71,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":8}},{"name":"flag","generated":{"line":71,"column":9},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":9}},{"generated":{"line":71,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":13}},{"generated":{"line":71,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":14}},{"generated":{"line":71,"column":18},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":13}},{"generated":{"line":71,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":20}},{"generated":{"line":71,"column":30},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":13}},{"generated":{"line":71,"column":31},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":4}},{"generated":{"line":71,"column":33},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":69,"column":33}},{"name":"flag","generated":{"line":72,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":6}},{"name":"flag","generated":{"line":72,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":6}},{"generated":{"line":72,"column":10},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":10}},{"generated":{"line":72,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":11}},{"generated":{"line":72,"column":15},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":10}},{"generated":{"line":72,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":17}},{"generated":{"line":72,"column":23},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":10}},{"name":"overwritingMethodWrapper","generated":{"line":72,"column":25},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":25}},{"generated":{"line":72,"column":49},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":10}},{"generated":{"line":72,"column":50},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":70,"column":6}},{"generated":{"line":73,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":71,"column":5}},{"generated":{"line":73,"column":5},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":45}},{"generated":{"line":73,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":73,"column":4}},{"generated":{"line":74,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":74,"column":4}},{"generated":{"line":75,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":75,"column":4}},{"generated":{"line":78,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":4}},{"name":"origLockSsfi","generated":{"line":78,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":8}},{"generated":{"line":78,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":20}},{"name":"flag","generated":{"line":78,"column":23},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":23}},{"generated":{"line":78,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":27}},{"generated":{"line":78,"column":28},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":28}},{"generated":{"line":78,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":27}},{"generated":{"line":78,"column":34},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":34}},{"generated":{"line":78,"column":44},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":27}},{"generated":{"line":78,"column":45},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":76,"column":4}},{"name":"flag","generated":{"line":79,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":4}},{"name":"flag","generated":{"line":79,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":4}},{"generated":{"line":79,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":8}},{"generated":{"line":79,"column":9},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":9}},{"generated":{"line":79,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":8}},{"generated":{"line":79,"column":15},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":15}},{"generated":{"line":79,"column":25},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":8}},{"generated":{"line":79,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":27}},{"generated":{"line":79,"column":31},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":8}},{"generated":{"line":79,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":77,"column":4}},{"generated":{"line":80,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":4}},{"name":"result","generated":{"line":80,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":8}},{"generated":{"line":80,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":14}},{"name":"method","generated":{"line":80,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":17}},{"generated":{"line":80,"column":23},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":23}},{"name":"_super","generated":{"line":80,"column":24},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":24}},{"generated":{"line":80,"column":30},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":23}},{"generated":{"line":80,"column":31},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":17}},{"name":"apply","generated":{"line":80,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":32}},{"generated":{"line":80,"column":37},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":17}},{"generated":{"line":80,"column":38},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":38}},{"generated":{"line":80,"column":42},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":17}},{"name":"arguments","generated":{"line":80,"column":44},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":44}},{"generated":{"line":80,"column":53},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":17}},{"generated":{"line":80,"column":54},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":78,"column":4}},{"name":"flag","generated":{"line":81,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":4}},{"name":"flag","generated":{"line":81,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":4}},{"generated":{"line":81,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":8}},{"generated":{"line":81,"column":9},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":9}},{"generated":{"line":81,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":8}},{"generated":{"line":81,"column":15},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":15}},{"generated":{"line":81,"column":25},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":8}},{"name":"origLockSsfi","generated":{"line":81,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":27}},{"generated":{"line":81,"column":39},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":8}},{"generated":{"line":81,"column":40},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":79,"column":4}},{"generated":{"line":83,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":4}},{"name":"result","generated":{"line":83,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":8}},{"generated":{"line":83,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":14}},{"name":"undefined","generated":{"line":83,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":19}},{"generated":{"line":83,"column":28},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":4}},{"generated":{"line":83,"column":30},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":81,"column":30}},{"generated":{"line":84,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":82,"column":6}},{"name":"result","generated":{"line":84,"column":13},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":82,"column":13}},{"generated":{"line":84,"column":19},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":82,"column":6}},{"generated":{"line":85,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":83,"column":5}},{"generated":{"line":87,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":4}},{"name":"newAssertion","generated":{"line":87,"column":8},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":8}},{"generated":{"line":87,"column":20},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":20}},{"generated":{"line":87,"column":23},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":23}},{"name":"chai","generated":{"line":87,"column":27},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":27}},{"generated":{"line":87,"column":31},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":31}},{"name":"Assertion","generated":{"line":87,"column":32},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":32}},{"generated":{"line":87,"column":41},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":23}},{"generated":{"line":87,"column":43},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":85,"column":4}},{"name":"transferFlags","generated":{"line":88,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":4}},{"name":"transferFlags","generated":{"line":88,"column":4},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":4}},{"generated":{"line":88,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":17}},{"generated":{"line":88,"column":18},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":18}},{"generated":{"line":88,"column":22},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":17}},{"name":"newAssertion","generated":{"line":88,"column":24},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":24}},{"generated":{"line":88,"column":36},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":17}},{"generated":{"line":88,"column":37},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":86,"column":4}},{"generated":{"line":89,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":87,"column":4}},{"name":"newAssertion","generated":{"line":89,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":87,"column":11}},{"generated":{"line":89,"column":23},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":87,"column":4}},{"generated":{"line":90,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":88,"column":3}},{"generated":{"line":90,"column":3},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":56,"column":2}},{"name":"addLengthGuard","generated":{"line":92,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":2}},{"name":"addLengthGuard","generated":{"line":92,"column":2},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":2}},{"generated":{"line":92,"column":16},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":16}},{"name":"overwritingMethodWrapper","generated":{"line":92,"column":17},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":17}},{"generated":{"line":92,"column":41},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":16}},{"name":"name","generated":{"line":92,"column":43},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":43}},{"generated":{"line":92,"column":47},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":16}},{"generated":{"line":92,"column":49},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":49}},{"generated":{"line":92,"column":54},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":16}},{"generated":{"line":92,"column":55},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":90,"column":2}},{"name":"ctx","generated":{"line":93,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":2}},{"name":"ctx","generated":{"line":93,"column":2},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":2}},{"generated":{"line":93,"column":5},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":5}},{"name":"name","generated":{"line":93,"column":6},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":6}},{"generated":{"line":93,"column":10},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":5}},{"generated":{"line":93,"column":11},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":2}},{"name":"proxify","generated":{"line":93,"column":14},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":14}},{"generated":{"line":93,"column":21},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":21}},{"name":"overwritingMethodWrapper","generated":{"line":93,"column":22},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":22}},{"generated":{"line":93,"column":46},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":21}},{"name":"name","generated":{"line":93,"column":48},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":48}},{"generated":{"line":93,"column":52},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":21}},{"generated":{"line":93,"column":53},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":91,"column":2}},{"generated":{"line":94,"column":0},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":92,"column":1}},{"generated":{"line":94,"column":1},"source":"node_modules/chai/lib/chai/utils/overwriteMethod.js","original":{"line":47,"column":0}}],"sources":{"node_modules/chai/lib/chai/utils/overwriteMethod.js":"/*!\n * Chai - overwriteMethod utility\n * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>\n * MIT Licensed\n */\n\nvar addLengthGuard = require('./addLengthGuard');\nvar chai = require('../../chai');\nvar flag = require('./flag');\nvar proxify = require('./proxify');\nvar transferFlags = require('./transferFlags');\n\n/**\n * ### .overwriteMethod(ctx, name, fn)\n *\n * Overwrites an already existing method and provides\n * access to previous function. Must return function\n * to be used for name.\n *\n * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {\n * return function (str) {\n * var obj = utils.flag(this, 'object');\n * if (obj instanceof Foo) {\n * new chai.Assertion(obj.value).to.equal(str);\n * } else {\n * _super.apply(this, arguments);\n * }\n * }\n * });\n *\n * Can also be accessed directly from `chai.Assertion`.\n *\n * chai.Assertion.overwriteMethod('foo', fn);\n *\n * Then can be used as any other assertion.\n *\n * expect(myFoo).to.equal('bar');\n *\n * @param {Object} ctx object whose method is to be overwritten\n * @param {String} name of method to overwrite\n * @param {Function} method function that returns a function to be used for name\n * @namespace Utils\n * @name overwriteMethod\n * @api public\n */\n\nmodule.exports = function overwriteMethod(ctx, name, method) {\n var _method = ctx[name]\n , _super = function () {\n throw new Error(name + ' is not a function');\n };\n\n if (_method && 'function' === typeof _method)\n _super = _method;\n\n var overwritingMethodWrapper = function () {\n // Setting the `ssfi` flag to `overwritingMethodWrapper` causes this\n // function to be the starting point for removing implementation frames from\n // the stack trace of a failed assertion.\n //\n // However, we only want to use this function as the starting point if the\n // `lockSsfi` flag isn't set.\n //\n // If the `lockSsfi` flag is set, then either this assertion has been\n // overwritten by another assertion, or this assertion is being invoked from\n // inside of another assertion. In the first case, the `ssfi` flag has\n // already been set by the overwriting assertion. In the second case, the\n // `ssfi` flag has already been set by the outer assertion.\n if (!flag(this, 'lockSsfi')) {\n flag(this, 'ssfi', overwritingMethodWrapper);\n }\n\n // Setting the `lockSsfi` flag to `true` prevents the overwritten assertion\n // from changing the `ssfi` flag. By this point, the `ssfi` flag is already\n // set to the correct starting point for this assertion.\n var origLockSsfi = flag(this, 'lockSsfi');\n flag(this, 'lockSsfi', true);\n var result = method(_super).apply(this, arguments);\n flag(this, 'lockSsfi', origLockSsfi);\n\n if (result !== undefined) {\n return result;\n }\n\n var newAssertion = new chai.Assertion();\n transferFlags(this, newAssertion);\n return newAssertion;\n }\n\n addLengthGuard(overwritingMethodWrapper, name, false);\n ctx[name] = proxify(overwritingMethodWrapper, name);\n};\n"},"lineCount":null}},"hash":"4afdeeff0e126886efdee4c6be820abc","cacheData":{"env":{}}} |