Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

binding.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. class Binding {
  7. constructor({
  8. identifier,
  9. scope,
  10. path,
  11. kind
  12. }) {
  13. this.identifier = void 0;
  14. this.scope = void 0;
  15. this.path = void 0;
  16. this.kind = void 0;
  17. this.constantViolations = [];
  18. this.constant = true;
  19. this.referencePaths = [];
  20. this.referenced = false;
  21. this.references = 0;
  22. this.identifier = identifier;
  23. this.scope = scope;
  24. this.path = path;
  25. this.kind = kind;
  26. this.clearValue();
  27. }
  28. deoptValue() {
  29. this.clearValue();
  30. this.hasDeoptedValue = true;
  31. }
  32. setValue(value) {
  33. if (this.hasDeoptedValue) return;
  34. this.hasValue = true;
  35. this.value = value;
  36. }
  37. clearValue() {
  38. this.hasDeoptedValue = false;
  39. this.hasValue = false;
  40. this.value = null;
  41. }
  42. reassign(path) {
  43. this.constant = false;
  44. if (this.constantViolations.indexOf(path) !== -1) {
  45. return;
  46. }
  47. this.constantViolations.push(path);
  48. }
  49. reference(path) {
  50. if (this.referencePaths.indexOf(path) !== -1) {
  51. return;
  52. }
  53. this.referenced = true;
  54. this.references++;
  55. this.referencePaths.push(path);
  56. }
  57. dereference() {
  58. this.references--;
  59. this.referenced = !!this.references;
  60. }
  61. }
  62. exports.default = Binding;