Skip to content

Commit e0b0a09

Browse files
committed
fix(pyTypeFactory): bound functions are no longer JSFunction objects in SpiderMonkey 115 ESR
1 parent ae703be commit e0b0a09

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pyTypeFactory.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted<JSObject *> *thisObj, JS::Rooted
106106
}
107107
js::ESClass cls;
108108
JS::GetBuiltinClass(cx, obj, &cls);
109+
if (JS_ObjectIsBoundFunction(obj)) {
110+
cls = js::ESClass::Function; // In SpiderMonkey 115 ESR, bound function is no longer a JSFunction but a js::BoundFunctionObject.
111+
// js::ESClass::Function only assigns to JSFunction objects by JS::GetBuiltinClass.
112+
}
109113
switch (cls) {
110114
case js::ESClass::Boolean: {
111115
// TODO (Caleb Aikens): refactor out all `js::Unbox` calls

0 commit comments

Comments
 (0)