Skip to content

Commit 1121393

Browse files
authored
Merge pull request #1403 from RReverser/expose-constructor
Add `constructor` property to `Object`
2 parents 30b2585 + db17e9d commit 1121393

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/js-sys/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,13 @@ extern "C" {
18781878
pub fn assign3(target: &Object, source1: &Object, source2: &Object, source3: &Object)
18791879
-> Object;
18801880

1881+
/// The constructor property returns a reference to the Object constructor
1882+
/// function that created the instance object.
1883+
///
1884+
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor)
1885+
#[wasm_bindgen(method, getter)]
1886+
pub fn constructor(this: &Object) -> Function;
1887+
18811888
/// The Object.create() method creates a new object, using an existing
18821889
/// object to provide the newly created object's prototype.
18831890
///

0 commit comments

Comments
 (0)