diff --git a/test/index.html b/test/index.html
index fc56f4dcd..df5e8dd97 100644
--- a/test/index.html
+++ b/test/index.html
@@ -44,6 +44,8 @@
Object._keys = Object.keys;
Object.keys = function() {};
+ window.WinRTError = Error;
+
window.clearTimeout = (function(fn) {
window._clearTimeout = fn;
return function(id) {
@@ -95,6 +97,8 @@
} else {
delete Object.keys;
}
+ window.WinRTError = undefined;
+
window.clearTimeout = _clearTimeout;
window._clearTimeout = undefined;
diff --git a/test/test.js b/test/test.js
index 67beb8fc0..703697082 100644
--- a/test/test.js
+++ b/test/test.js
@@ -227,6 +227,9 @@
'})'
].join('\n')));
+ // fake `WinRTError`
+ global.WinRTError = Error;
+
// fake dom
var window = global.window = {};
window.document = {};
@@ -279,6 +282,7 @@
global.setTimeout = _setTimeout;
delete global.window;
+ delete global.WinRTError;
delete Function.prototype._method;
} catch(e) { }
}
@@ -1412,6 +1416,7 @@
if (_.support.funcNames) {
_.support.funcNames = false;
_.createCallback(c, object);
+
ok('__bindData__' in c);
_.support.funcNames = true;
}
@@ -1423,6 +1428,18 @@
skipTest(3);
}
});
+
+ test('should not write `__bindData__` when `_.support.funcDecomp` is `false`', 1, function() {
+ function a() {};
+
+ if (defineProperty && lodashBizarro) {
+ lodashBizarro.createCallback(a, {});
+ equal('__bindData__' in a, false);
+ }
+ else {
+ skipTest();
+ }
+ });
}());
/*--------------------------------------------------------------------------*/