JavaScriptCore bridges Swift's nil to JavaScript's undefined. We advertise a lot of our methods as returning something or null.
In JavaScript, null == undefined is True, but null === undefined is False.
We either need to be ok with forcing users to use loose equality tests on our return types, or rewrite all of our methods that might return nil to return JSValue() so the nil cases can return JSValue(nullIn: context).
JavaScriptCore bridges Swift's
nilto JavaScript'sundefined. We advertise a lot of our methods as returning something ornull.In JavaScript,
null==undefinedis True, butnull===undefinedis False.We either need to be ok with forcing users to use loose equality tests on our return types, or rewrite all of our methods that might return
nilto returnJSValue()so thenilcases can returnJSValue(nullIn: context).