Skip to content

Commit ba418e8

Browse files
committed
update "array-index" to v1
1 parent cce5fb9 commit ba418e8

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

lib/array.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,6 @@ module.exports = function Array (_type, _length) {
103103
writable: true,
104104
configurable: true
105105
},
106-
// part of the "array-index" interface
107-
__get__: {
108-
value: getter,
109-
enumerable: true,
110-
writable: true,
111-
configurable: true
112-
},
113-
// part of the "array-index" interface
114-
__set__: {
115-
value: setter,
116-
enumerable: true,
117-
writable: true,
118-
configurable: true
119-
},
120106
// "node-ffi" calls this when passed an array instance to an ffi'd function
121107
ref: {
122108
value: ref,
@@ -133,6 +119,10 @@ module.exports = function Array (_type, _length) {
133119
}
134120
})
135121

122+
// part of the "array-index" interface
123+
ArrayType.prototype[ArrayIndex.get] = getter
124+
ArrayType.prototype[ArrayIndex.set] = setter
125+
136126
// save down the "fixedLength" if specified. "ref-struct" needs this value
137127
if (fixedLength > 0) {
138128
ArrayType.fixedLength = fixedLength

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test": "node-gyp rebuild --directory test && mocha -gc --reporter spec"
1818
},
1919
"dependencies": {
20-
"array-index": "~0.1.1",
20+
"array-index": "1",
2121
"debug": "2",
2222
"ref": "1"
2323
},

0 commit comments

Comments
 (0)