private static ScriptValue LastIndexOf(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue ToLocaleString(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue IsFinite(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue GetInt16(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue Throw(ScriptArguments arg) { throw new System.NotImplementedException(); }
private static ScriptValue Is([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-object.is return(arg[0].SameValue(arg[1])); }
private static ScriptValue ValueOf([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-object.prototype.valueof return(arg.Agent.ToObject(arg.ThisValue)); }
private static ScriptValue Pow([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-math.pow return(EvaluateWalker.Exponentiation(arg[0], arg[1], arg.Agent)); }
private static ScriptValue Random([NotNull] ScriptArguments arg) { return(arg.Function.Realm.Random.NextDouble()); }
private static ScriptValue Ceiling([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-math.ceil return(Math.Ceiling(arg.Agent.ToNumber(arg[0]))); }
private static ScriptValue Fround(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue TypedArray(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue GetToStringTag(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue ReduceRight(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue GetOwnPropertyNames([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-object.getownpropertynames return(GetOwnPropertyKeys(arg.Agent, arg[0], ScriptValue.Type.String)); }
private static ScriptValue Sin([NotNull] ScriptArguments arg) { return(Math.Sin(arg.Agent.ToNumber(arg[0]))); }
private static ScriptValue GetOwnPropertySymbols([NotNull] ScriptArguments arg) { return(GetOwnPropertyKeys(arg.Agent, arg[0], ScriptValue.Type.Symbol)); }
private static ScriptValue Atan([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-math.atan return(Math.Atan(arg.Agent.ToNumber(arg[0]))); }
private static ScriptValue ToString([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-object.prototype.tostring if (arg.ThisValue == ScriptValue.Undefined) { return("[object Undefined]"); } if (arg.ThisValue == ScriptValue.Null) { return("[object Null]"); } var obj = arg.Agent.ToObject(arg.ThisValue); string builtinTag; if (arg.Agent.IsArray(obj)) { builtinTag = "Array"; } else if (obj is ScriptStringObject) { builtinTag = "String"; } else if (obj.SpecialObjectType == SpecialObjectType.ArgumentsObject) { builtinTag = "Arguments"; } else if (obj.IsCallable) { builtinTag = "Function"; } else { switch (obj.SpecialObjectType) { case SpecialObjectType.Error: builtinTag = "Error"; break; case SpecialObjectType.Boolean: builtinTag = "Boolean"; break; case SpecialObjectType.Number: builtinTag = "Number"; break; case SpecialObjectType.Date: builtinTag = "Date"; break; case SpecialObjectType.RegExp: builtinTag = "RegExp"; break; default: builtinTag = "Object"; break; } } var tag = obj.Get(Symbol.ToStringTag); if (tag.IsString) { builtinTag = (string)tag; } return($"[object {builtinTag}]"); }
private static ScriptValue SharedArrayBuffer(ScriptArguments arg) { throw new System.NotImplementedException(); }
private static ScriptValue GetByteOffset(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue GetByteLength(ScriptArguments arg) { throw new System.NotImplementedException(); }
private static ScriptValue SetUint32(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue ToPrimitive([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive return(ThisSymbolValue(arg.Agent, arg.ThisValue)); }
private static ScriptValue GeneratorFunction([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-generatorfunction return(FunctionIntrinsics.CreateDynamicFunction(arg.Function, arg.NewTarget, FunctionKind.Generator, arg)); }
private static ScriptValue Iterator([NotNull] ScriptArguments arg) { return(arg.ThisValue); }
private static ScriptValue ValueOf([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-number.prototype.valueof return(ThisNumberValue(arg.Agent, arg.ThisValue)); }
private static ScriptValue DefineProperties([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-object.defineproperties return(ObjectDefineProperties(arg.Agent, arg[0], arg[1])); }
private static ScriptValue IsSafeInteger(ScriptArguments arg) { throw new NotImplementedException(); }
private static ScriptValue Includes(ScriptArguments arg) { throw new NotImplementedException(); }