mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 03:01:48 +03:00
15 lines
435 B
JavaScript
15 lines
435 B
JavaScript
export function _is_native_reflect_construct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
if (Reflect.construct.sham) return false;
|
|
if (typeof Proxy === "function") return true;
|
|
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
export { _is_native_reflect_construct as _ };
|