zjquery: Add to_$ hook so elements can wrap themselves.

This commit is contained in:
Steve Howell
2018-04-12 15:37:34 +00:00
committed by Tim Abbott
parent f505f3de04
commit 174d065b2e

View File

@@ -314,6 +314,15 @@ exports.make_zjquery = function () {
return arg;
}
}
// We occasionally create stub objects that know
// they want to be wrapped by jQuery (so they can
// in turn return stubs). The convention is that
// they provide a to_$ attribute.
if (arg.to_$) {
assert(typeof arg.to_$ === "function");
return arg.to_$();
}
}
if (arg2 !== undefined) {