Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 291ef02

Browse files
committed
coerce mirror property names to strings
For array indices in Node 4.x+ the property mirror's names are integers instead of strings.
1 parent 7967cc9 commit 291ef02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/state.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,18 @@ StateResolver.prototype.getMirrorProperties_ = function(mirror) {
442442
};
443443

444444
StateResolver.prototype.resolveMirrorProperty_ = function(property) {
445+
var name = String(property.name);
445446
if (property.isNative()) {
446447
return {
447-
name: property.name(),
448+
name: name,
448449
varTableIndex: NATIVE_PROPERTY_MESSAGE_INDEX
449450
};
450451
}
451452
if (property.hasGetter()) {
452453
return {
453-
name: property.name(),
454+
name: name,
454455
varTableIndex: GETTER_MESSAGE_INDEX
455456
};
456457
}
457-
return this.resolveVariable_(property.name(), property.value());
458+
return this.resolveVariable_(name, property.value());
458459
};

0 commit comments

Comments
 (0)