Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Uncaught TypeError: Property '__zone_symbol__then' of object [object Promise] is not a function #1078

Description

@rudgal

Observed this on Mobile Chrome/33.0.1750.170 using zone.js 0.8.26:
__zone_symbol__then
Although that's a pretty outdated browser, I'm still reporting it just in case the issue occurs with other userAgents too.

I tracked the problem down to the following code snippet that patches the then-method of Promise

 function patchThen(Ctor: Function) {
const proto = Ctor.prototype;
const prop = ObjectGetOwnPropertyDescriptor(proto, 'then');
if (prop && (prop.writable === false || !prop.configurable)) {
// check Ctor.prototype.then propertyDescriptor is writable or not
// in meteor env, writable is false, we should ignore such case
return;
}
const originalThen = proto.then;
// Keep a reference to the original method.
proto[symbolThen] = originalThen;
.
.
.

In case of chrome 33 then is initially not configurable, hence patchThen returns before the original method is patched.
image

Compared to current chrome:
image

Imho the reference to originalThen should be kept, even if the properties indicate that it is not writable or not configurable. This was the case prior to the changes with #1041 .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions