Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.
This repository was archived by the owner on May 30, 2023. It is now read-only.

ReferenceError: Can't find variable: Promise #12401

Closed
@liliakai

Description

@liliakai

I'm using mocha-phantomjs 3.5.0 (phantomjs 1.9.7). My mocha tests pass in Chrome but phantom gives the error above.

👻

Activity

JamesMGreene

JamesMGreene commented on Jul 25, 2014

@JamesMGreene
Collaborator

Native Promises are an extremely recent addition (I'm not even sure if it's officially standard yet), so this is not surprising whatsoever. Are there native Promises in your code/tests, or is the error coming from mocha-phantomjs?

liliakai

liliakai commented on Jul 25, 2014

@liliakai
Author

They're in my code. Any plan to add support in the near future? Or do you know of any other headless browsers that have implemented them? I suppose I'll have to shim them into my test page otherwise.

Also, (and this is a separate issue, but) same question regarding support for Array-like objects in Function.prototype.apply.

piuccio

piuccio commented on Nov 18, 2014

@piuccio

+1 😄

Gowiem

Gowiem commented on Dec 9, 2014

@Gowiem

+1

gergely-ujvari

gergely-ujvari commented on Dec 10, 2014

@gergely-ujvari

+1

Aurifier

Aurifier commented on Dec 18, 2014

@Aurifier

👍

zzarcon

zzarcon commented on Jan 5, 2015

@zzarcon

@JamesMGreene some update about this? :)

zzarcon

zzarcon commented on Jan 5, 2015

@zzarcon

I ended using a simple workaround; adding this Promise Polyfill at the beginning of the tests, hope be util for you!

JamesMGreene

JamesMGreene commented on Jan 5, 2015

@JamesMGreene
Collaborator

Although the current master isn't quite where we hoped it would be, we are planning to release it as v2.0.0 on January 23rd (?) and work out the remaining kinks from there once we can all shift focus to v2.x.

JamesMGreene

JamesMGreene commented on Jan 5, 2015

@JamesMGreene
Collaborator

That said: I have not verified that the native Promise API is implemented in master.

vitallium

vitallium commented on Jan 5, 2015

@vitallium
Collaborator

PhantomJS 2 doesn't have native Promise API.

fredck

fredck commented on Feb 20, 2015

@fredck

+1

Promise is available natively in all modern browsers except IEs (IE12 has it)... it's a must have!

MrJH

MrJH commented on Feb 25, 2015

@MrJH

+1

masi

masi commented on Mar 21, 2015

@masi

Node has Promises, ECMA6 will have them and notably SilmerJS has them already. The SlimerJS devs had the idea to make webpage.open to return a Promise which is IMHO a great improvement to the API.

48 remaining items

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @ariya@SourceCode@mockdeep@danawoodman@JamesMGreene

      Issue actions

        ReferenceError: Can't find variable: Promise · Issue #12401 · ariya/phantomjs