Skip to content

Return value instead of the getter function for rewritten intrinsics #5

Open
@iFwu

Description

@iFwu

Under some environments like WeChat Mini Program, built-in intrinsics are rewritten to prevent further modification. And the over-written code use getter/setter to hook property access and setting.
For example, when calling GetIntrinsic('%Reflect.apply%') it will return the override getter function instead of the apply function itself. That will cause many TypeError during the initialization of the es-extract module.

One possible fix is to list all native properties that use the getter/setter, e.g. Map.prototype.size. Only when getting such properties, return the getter. Otherwise, GetIntrinsic always return the value return from get().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions