impl Body mixin for dom::Response and dom::Request

This commit is contained in:
Malisa Smith 2016-09-08 15:50:22 -07:00 committed by Keith Yeung
parent 6a0c70a222
commit a5e5cd0e9e
18 changed files with 332 additions and 167 deletions

View file

@ -10,10 +10,9 @@
interface Body {
readonly attribute boolean bodyUsed;
// Servo does not support Promise at this moment.
// [NewObject] Promise<ArrayBuffer> arrayBuffer();
// [NewObject] Promise<Blob> blob();
// [NewObject] Promise<FormData> formData();
// [NewObject] Promise<JSON> json();
// [NewObject] Promise<USVString> text();
[NewObject] Promise<Blob> blob();
[NewObject] Promise<FormData> formData();
[NewObject] Promise<any> json();
[NewObject] Promise<USVString> text();
};

View file

@ -4,8 +4,7 @@
// https://fetch.spec.whatwg.org/#response-class
// TODO: pass 'optional ResponseBodyInit? body = null' to constructor in place of USVString
[Constructor(optional USVString? body = null, optional ResponseInit init),
[Constructor(optional BodyInit? body = null, optional ResponseInit init),
Exposed=(Window,Worker)]
interface Response {
[NewObject] static Response error();