aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-05-06 12:53:37 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-05-06 12:53:37 +0300
commitfd3d9cc489400b90bb578cab7a6fece69e161fe0 (patch)
treeb3b399a84a35fdb96690067057119673dc6d652a
parent0794b09cd748a3ca6eb111d57f8cfcfce852b2a0 (diff)
Apply Chad's fix from issue #2335 to fix other.test_embind.
-rw-r--r--src/embind/embind.js9
-rw-r--r--tests/embind/imvu_test_adapter.js6
2 files changed, 6 insertions, 9 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 3eadb85f..4821c77b 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -1525,9 +1525,12 @@ function downcastPointer(ptr, ptrClass, desiredClass) {
if (undefined === desiredClass.baseClass) {
return null; // no conversion
}
- // O(depth) stack space used
- return desiredClass.downcast(
- downcastPointer(ptr, ptrClass, desiredClass.baseClass));
+
+ var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);
+ if (rv === null) {
+ return null;
+ }
+ return desiredClass.downcast(rv);
}
function upcastPointer(ptr, ptrClass, desiredClass) {
diff --git a/tests/embind/imvu_test_adapter.js b/tests/embind/imvu_test_adapter.js
index 421e86c8..93eeab37 100644
--- a/tests/embind/imvu_test_adapter.js
+++ b/tests/embind/imvu_test_adapter.js
@@ -586,12 +586,6 @@ function module(ignore, func) {
throw new AssertionError("Don't call setInterval in tests. Use fakes.");
};
- if (typeof process !== 'undefined') {
- process.nextTick = function() {
- throw new AssertionError("Don't call process.nextTick in tests. Use fakes.");
- };
- }
-
Math.random = function() {
throw new AssertionError("Don't call Math.random in tests. Use fakes.");
};