Skip to content

Commit 40fa2f6

Browse files
committed
Made fields private
1 parent 13f674d commit 40fa2f6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/asbind-instance.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ export default class AsbindInstance {
3232
constructor() {
3333
this.unboundExports = {};
3434
this.exports = {};
35-
this.importObject = {};
35+
this._importObject = {};
3636
}
3737

38-
async instantiate(source, importObject) {
38+
async _instantiate(source, importObject) {
3939
// Set our import object, as we will need it to store type caching
40-
this.importObject = importObject;
40+
this._importObject = importObject;
4141

4242
// Need to traverse the importObject and bind all import functions
4343
traverseObjectAndRunCallbackForFunctions(
44-
this.importObject,
44+
this._importObject,
4545
[],
4646
(baseObject, keys, baseObjectKey) => {
4747
// Wrap the original key, but then expose a new key for the unbound import
4848
let importFunction = baseObject[baseObjectKey];
4949
baseObject[`__asbind_unbound_${baseObjectKey}`] = importFunction;
5050
baseObject[baseObjectKey] = bindImportFunction(
5151
this,
52-
this.importObject,
52+
this._importObject,
5353
[...keys, baseObjectKey]
5454
);
5555
}
5656
);
5757

5858
// Instantiate the module through the loader
59-
this.unboundExports = await asbindInstantiate(source, this.importObject);
59+
this.unboundExports = await asbindInstantiate(source, this._importObject);
6060

6161
// Wrap appropriate the appropriate export functions
6262
this.exports = {};
@@ -91,7 +91,7 @@ export default class AsbindInstance {
9191
enableImportFunctionTypeCaching() {
9292
// Need to traverse the importObject and bind all import functions
9393
traverseObjectAndRunCallbackForFunctions(
94-
this.importObject,
94+
this._importObject,
9595
[],
9696
(baseObject, keys, baseObjectKey) => {
9797
// Wrap the original key, but then expose a new key for the unbound import
@@ -104,7 +104,7 @@ export default class AsbindInstance {
104104
disableImportFunctionTypeCaching() {
105105
// Need to traverse the importObject and bind all import functions
106106
traverseObjectAndRunCallbackForFunctions(
107-
this.importObject,
107+
this._importObject,
108108
[],
109109
(baseObject, keys, baseObjectKey) => {
110110
// Wrap the original key, but then expose a new key for the unbound import

lib/lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const AsBind = {
88
// Our APIs
99
instantiate: async (source, importObject) => {
1010
let asbindInstance = new AsbindInstance();
11-
await asbindInstance.instantiate(source, importObject);
11+
await asbindInstance._instantiate(source, importObject);
1212
return asbindInstance;
1313
}
1414
};

0 commit comments

Comments
 (0)