You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,7 @@ Returns a boolean indicating whether _value_ is an instance of the wrapper class
258
258
259
259
This is useful in other parts of your program that are not implementation class files, but instead receive wrapper classes from client code.
260
260
261
-
#### `convert(value, { context })`
261
+
#### `convert(globalObject, value, { context })`
262
262
263
263
Performs the Web IDL conversion algorithm for this interface, converting _value_ into the correct representation of the interface type suitable for consumption by implementation classes: the corresponding impl.
264
264
@@ -296,13 +296,13 @@ jsdom does this for `Window`, which is written in custom, non-webidl2js-generate
296
296
297
297
### For callback interfaces
298
298
299
-
#### `convert(value, { context })`
299
+
#### `convert(globalObject, value, { context })`
300
300
301
-
Performs the Web IDL conversion algorithm for this callback interface, converting _value_ into a function that performs [call a user object's operation](https://heycam.github.io/webidl/#call-a-user-objects-operation) when called, with _thisArg_ being the `this` value of the converted function.
301
+
Performs the Web IDL conversion algorithm for this callback interface, converting `value` into a function that performs [call a user object's operation](https://heycam.github.io/webidl/#call-a-user-objects-operation) when called, with _thisArg_ being the `this` value of the converted function. `globalObject` is used to ensure error cases result in `Error` or `Promise` objects from the correct realm.
302
302
303
-
The resulting function has an _objectReference_ property, which is the same object as _value_ and can be used to perform identity checks, as `convert` returns a new function object every time.
303
+
The resulting function has an `objectReference` property, which is the same object as `value` and can be used to perform identity checks, as `convert` returns a new function object every time.
304
304
305
-
If any part of the conversion fails, _context_ can be used to describe the provided value in any resulting error message.
305
+
If any part of the conversion fails, `context` can be used to describe the provided value in any resulting error message.
306
306
307
307
#### `install(globalObject, globalNames)`
308
308
@@ -312,11 +312,11 @@ The second argument `globalNames` is the same as for [the `install()` export for
312
312
313
313
### For dictionaries
314
314
315
-
#### `convert(value, { context })`
315
+
#### `convert(globalObject, value, { context })`
316
316
317
-
Performs the Web IDL conversion algorithm for this dictionary, converting _value_ into the correct representation of the dictionary type suitable for consumption by implementation classes: a `null`-[[Prototype]] object with its properties properly converted.
317
+
Performs the Web IDL conversion algorithm for this dictionary, converting `value` into the correct representation of the dictionary type suitable for consumption by implementation classes: a `null`-[[Prototype]] object with its properties properly converted. `globalObject` is used to ensure error cases result in `Error` or `Promise` objects from the correct realm.
318
318
319
-
If any part of the conversion fails, _context_ can be used to describe the provided value in any resulting error message.
319
+
If any part of the conversion fails, `context` can be used to describe the provided value in any resulting error message.
0 commit comments