protected void SetIntrinsicValue(JsSymbol symbol, JsValue value, bool writable, bool enumerable, bool configurable) { if (_intrinsicProperties == null) { _intrinsicProperties = new Dictionary <string, PropertyDescriptor>(); } _intrinsicProperties[symbol.AsSymbol()] = new PropertyDescriptor(value, writable, enumerable, configurable); }
protected bool TryGetIntrinsicValue(JsSymbol symbol, out JsValue value) { PropertyDescriptor descriptor; if (_intrinsicProperties != null && _intrinsicProperties.TryGetValue(symbol.AsSymbol(), out descriptor)) { value = descriptor.Value; return(true); } if (ReferenceEquals(Prototype, null)) { value = Undefined; return(false); } return(Prototype.TryGetIntrinsicValue(symbol, out value)); }
public string SymbolDescriptiveString(JsSymbol sym) { return($"Symbol({sym.AsSymbol()})"); }