aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.");
};