Summary
In compiled mode, built-in constructors held as values (the System.Type token representation — Object, Date, Array, ...) report typeof === "function", but tag-based classification (Object.prototype.toString.call(x) / lodash''s baseGetTag) does not produce [object Function] for them. lodash''s isFunction(Object) therefore returns false and baseIsNative falls into the host-constructor path (reIsHostCtor), which happens to match, so lodash init survives — but the divergence is observable to any guest code that classifies by toString tag.
Observed while validating #307 against compiled lodash:
DBG baseIsNative: value=function // typeof Object
DBG b4 f=false // lodash isFunction(Object) — wrong, true in Node
Repro sketch
var O = Object;
console.log(typeof O); // "function" (correct)
console.log(Object.prototype.toString.call(O)); // expected "[object Function]"
Suggested direction
The toString-tag dispatch (wherever ObjectToString/baseGetTag-visible tagging happens for System.Type receivers) should classify constructor Type tokens as [object Function], matching their typeof.
Environment
- branch
fix/307-inner-fndecl-arrow-capture; .NET 10.0, Windows 11
Summary
In compiled mode, built-in constructors held as values (the
System.Typetoken representation —Object,Date,Array, ...) reporttypeof === "function", but tag-based classification (Object.prototype.toString.call(x)/ lodash''sbaseGetTag) does not produce[object Function]for them. lodash''sisFunction(Object)therefore returns false andbaseIsNativefalls into the host-constructor path (reIsHostCtor), which happens to match, so lodash init survives — but the divergence is observable to any guest code that classifies by toString tag.Observed while validating #307 against compiled lodash:
Repro sketch
Suggested direction
The toString-tag dispatch (wherever
ObjectToString/baseGetTag-visible tagging happens forSystem.Typereceivers) should classify constructor Type tokens as[object Function], matching theirtypeof.Environment
fix/307-inner-fndecl-arrow-capture; .NET 10.0, Windows 11