Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Promise in Servo #4282

Closed
tetsuharuohzeki opened this issue Dec 8, 2014 · 11 comments
Closed

Implement Promise in Servo #4282

tetsuharuohzeki opened this issue Dec 8, 2014 · 11 comments

Comments

@tetsuharuohzeki
Copy link
Member

@tetsuharuohzeki tetsuharuohzeki commented Dec 8, 2014

We need ES6 Promise implementation to support some APIs and dogfooding. However, SpiderMonkey has not been implemented it yet because there are a web standards problems with how the JS virtual machine's event loop should interact with the event loop of the web browser itself.

Therefore, we need to implement Promise in Servo until SM gets Promise in itself.

See also: https://github.com/servo/servo/wiki/Mozlandia-JS#promises

@tetsuharuohzeki tetsuharuohzeki changed the title Implement Promsie in Servo Implement Promise in Servo Dec 8, 2014
@farodin91
Copy link
Contributor

@farodin91 farodin91 commented Jul 29, 2015

I like to do this.

@jdm
Copy link
Member

@jdm jdm commented Jul 29, 2015

At least #4283 needs to be completed first, and we probably need to run any proposed design by the more-experienced Gecko developers first to make sure we don't do anything silly.

@farodin91
Copy link
Contributor

@farodin91 farodin91 commented Jul 29, 2015

Okay

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Oct 6, 2015

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Jan 26, 2016

@tschneidereit is planning to work on this in Q1.

@tschneidereit
Copy link
Contributor

@tschneidereit tschneidereit commented Jan 26, 2016

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented May 12, 2016

It looks like @nox landed the SpiderMonkey update with your work!

@tschneidereit do you know what the timeline is for promises in Servo?

The WebBluetooth folks (cc @loki04) were wondering. Thanks!

@nox
Copy link
Member

@nox nox commented May 12, 2016

IIRC they can't enable SM promises yet in Gecko itself because of win32 issues, but @tschneidereit knows all there is to know about them so let's wait for his reply.

@jdm
Copy link
Member

@jdm jdm commented Jun 21, 2016

10:01 <till> jdm: we can prototype it right now. For actually enabling it we *need* bug 1272887 and bug 1280789, and *want* half of the patches pending review in bug 911216
10:01 <firebot> https://bugzil.la/1272887 — FIXED, sphink — win32 crash during GC when using PersistentRooted<GCVector>
10:01 <firebot> https://bugzil.la/1280789 — FIXED — unbreak mingw builds after 1272887
10:01 <firebot> https://bugzil.la/911216 — ASSIGNED, till — Implement promises in the JavaScript engine
10:01 <jdm> till: ok, so an SM upgrade right now won't even get us to the point we'll need to be at?
10:01 <till> jdm: in other words, a smup beginning next week :)

I'm going to start prototyping codegen integration.

@jdm
Copy link
Member

@jdm jdm commented Jun 21, 2016

master...jdm:promise-binding is what I've got so far. The rooting story for the JS promise values is not great yet, but it's probably no worse than how we deal with EventTarget and other callbacks?

@jdm
Copy link
Member

@jdm jdm commented Jun 28, 2016

Blocks #11894.

@jdm jdm mentioned this issue Aug 12, 2016
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Aug 24, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 25, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 25, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Sep 6, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Sep 21, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Sep 22, 2016
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires servo/mozjs#89, servo/rust-mozjs#287, and servo/rust-mozjs#294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12830)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants
You can’t perform that action at this time.