ValueDescriptor.ts
23 lines
| 512 B
| video/mp2t
|
TypeScriptLexer
|
|
r34 | import { Descriptor } from "./interfaces"; | ||
| import { ActivationContext } from "./ActivationContext"; | ||||
|
|
r39 | export class ValueDescriptor implements Descriptor { | ||
| _value; | ||||
|
|
r34 | |||
|
|
r39 | constructor(value) { | ||
|
|
r34 | this._value = value; | ||
| } | ||||
| activate(context: ActivationContext, name: string) { | ||||
| context.enter(name); | ||||
|
|
r39 | const v = this._value; | ||
|
|
r34 | context.leave(); | ||
|
|
r39 | return v; | ||
|
|
r34 | } | ||
| isInstanceCreated(): boolean { | ||||
| return true; | ||||
| } | ||||
|
|
r39 | getInstance() { | ||
|
|
r34 | return this._value; | ||
| } | ||||
|
|
r39 | } | ||
