Пример #1
0
        private JsValue ToPrimitive(JsValue thisObject, JsValue[] arguments)
        {
            if (thisObject.IsSymbol())
            {
                return(thisObject);
            }

            // Steps 3. and 4.
            var o = thisObject.AsInstance <SymbolInstance>();

            if (ReferenceEquals(o, null))
            {
                ExceptionHelper.ThrowTypeError(Engine);
            }

            return(o.SymbolData);
        }