Skip to content

Commit 839fa5e

Browse files
committed
docs: Update README.md
1 parent 42e8cd5 commit 839fa5e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ will generate a JavaScript wrapper class file roughly like this:
2626

2727
```js
2828
const conversions = require("webidl-conversions");
29-
const impl = require("./utils.js").implSymbol;
30-
const ctorRegistry = require("./utils.js").ctorRegistrySymbol;
29+
const utils = require("./utils.js");
30+
31+
const { implSymbol, ctorRegistrySymbol } = utils;
3132

3233
const Impl = require("./SomeInterface-impl.js").implementation;
3334

@@ -56,7 +57,7 @@ class SomeInterface {
5657
context: "Failed to execute 'add' on 'SomeInterface': parameter 2"
5758
});
5859

59-
return this[impl].add(...args);
60+
return this[implSymbol].add(...args);
6061
}
6162
}
6263

@@ -66,13 +67,13 @@ Object.defineProperties(SomeInterface.prototype, {
6667
});
6768

6869
exports.create = (globalObject, constructorArgs = [], privateData = {}) => {
69-
const ctor = globalObject[ctorRegistry].SomeInterface;
70+
const ctor = globalObject[ctorRegistrySymbol].SomeInterface;
7071
const obj = Object.create(ctor.prototype);
71-
obj[impl] = new Impl(constructorArgs, privateData);
72+
obj[implSymbol] = new Impl(constructorArgs, privateData);
7273
return obj;
7374
};
7475

75-
exports.is = obj => obj && obj[impl] instanceof Impl;
76+
exports.is = obj => obj && obj[implSymbol] instanceof Impl;
7677
```
7778

7879
The above is a simplification of the actual generated code, but should give you some idea of what's going on. We bring your attention to a few points:

0 commit comments

Comments
 (0)