mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-30 19:41:56 +00:00
webidl: All interfaces implicitly extend Object
This information is embedded within the algorithm for constructing interfaces and their prototypes in the section for ECMAScript glue in the WebIDL spec... This really *should* make the `wasm_bindgen_backend::ast::ImportType::extends` member from a `Vec<Ident>` into a `Vec<syn::Path>` so that we could use `js_sys::Object` in the extends field, but that is a huge pain because then the `ImportedTypes` trait needs to be changed, and all of its implementers, etc...
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/array.rs"));
|
||||
|
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/array_buffer.rs"));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use js_sys::Function;
|
||||
use js_sys::{Function, Object};
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/callbacks.rs"));
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/consts.rs"));
|
||||
|
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/enums.rs"));
|
||||
|
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/global.rs"));
|
||||
|
@@ -1,9 +1,17 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/simple.rs"));
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn interfaces_inherit_from_object() {
|
||||
let m = Method::new(42.0).unwrap();
|
||||
assert!(m.is_instance_of::<Object>());
|
||||
let _: &Object = m.as_ref();
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn method() {
|
||||
let pi = Method::new(3.14159).unwrap();
|
||||
|
@@ -1,3 +1,4 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/throws.rs"));
|
||||
|
Reference in New Issue
Block a user