27 lines
315 B
JavaScript
27 lines
315 B
JavaScript
|
export class Literal {
|
||
|
|
||
|
constructor() {
|
||
|
this.value = null;
|
||
|
}
|
||
|
|
||
|
fromJSON(json) {
|
||
|
this.value = json.value;
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
get(context) {
|
||
|
return this.value;
|
||
|
}
|
||
|
|
||
|
set(value) {
|
||
|
this.value = value;
|
||
|
}
|
||
|
|
||
|
toJSON() {
|
||
|
return {
|
||
|
type: 'literal',
|
||
|
value: this.value,
|
||
|
}
|
||
|
}
|
||
|
}
|