123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var READ = 0x1;
- var WRITE = 0x2;
- var RW = READ | WRITE;
- var Reference = function () {
- function Reference(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
- _classCallCheck(this, Reference);
-
- this.identifier = ident;
-
- this.from = scope;
-
- this.tainted = false;
-
- this.resolved = null;
-
- this.flag = flag;
- if (this.isWrite()) {
-
- this.writeExpr = writeExpr;
-
- this.partial = partial;
-
- this.init = init;
- }
- this.__maybeImplicitGlobal = maybeImplicitGlobal;
- }
-
- _createClass(Reference, [{
- key: "isStatic",
- value: function isStatic() {
- return !this.tainted && this.resolved && this.resolved.scope.isStatic();
- }
-
- }, {
- key: "isWrite",
- value: function isWrite() {
- return !!(this.flag & Reference.WRITE);
- }
-
- }, {
- key: "isRead",
- value: function isRead() {
- return !!(this.flag & Reference.READ);
- }
-
- }, {
- key: "isReadOnly",
- value: function isReadOnly() {
- return this.flag === Reference.READ;
- }
-
- }, {
- key: "isWriteOnly",
- value: function isWriteOnly() {
- return this.flag === Reference.WRITE;
- }
-
- }, {
- key: "isReadWrite",
- value: function isReadWrite() {
- return this.flag === Reference.RW;
- }
- }]);
- return Reference;
- }();
- exports.default = Reference;
- Reference.READ = READ;
- Reference.WRITE = WRITE;
- Reference.RW = RW;
|