bugger-v8-client
Version:
Client for v8 debug protocol
21 lines (16 loc) • 483 B
JavaScript
;
var scopeEnumToString = [
'global', 'local', 'with', 'closure', 'catch', 'block', 'script'
];
function Scope(type, object) {
this.type = type;
this.object = object;
}
Scope.unmarshal = function(raw, reviver) {
var type = scopeEnumToString[raw.type];
var objectId = 'scope:' + raw.frameIndex + ':' + raw.index;
var object = raw.object ? reviver(raw.object) : {};
object.objectId = objectId;
return new Scope(type, object);
};
module.exports = Scope;