cst
Version:
JavaScript CST Implementation
63 lines (53 loc) • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Reference = function () {
function Reference(_ref) {
var node = _ref.node,
scope = _ref.scope,
read = _ref.read,
write = _ref.write,
type = _ref.type;
(0, _classCallCheck3.default)(this, Reference);
this.node = node;
this.scope = scope;
this.read = read;
this.write = write;
this.type = type;
}
(0, _createClass3.default)(Reference, [{
key: 'isRead',
value: function isRead() {
return this.read;
}
}, {
key: 'isWrite',
value: function isWrite() {
return this.write;
}
}, {
key: 'isReadOnly',
value: function isReadOnly() {
return this.read && !this.write;
}
}, {
key: 'isWriteOnly',
value: function isWriteOnly() {
return !this.read && this.write;
}
}, {
key: 'isReadWrite',
value: function isReadWrite() {
return this.read && this.write;
}
}]);
return Reference;
}();
exports.default = Reference;
//# sourceMappingURL=Reference.js.map