1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ECMASCRIPT_BUILTINS_BUILTINS_NUMBER_H 17 #define ECMASCRIPT_BUILTINS_BUILTINS_NUMBER_H 18 19 #include "ecmascript/base/builtins_base.h" 20 #include "ecmascript/js_tagged_value.h" 21 22 namespace panda::ecmascript::builtins { 23 class BuiltinsNumber : public base::BuiltinsBase { 24 public: 25 // 20.1.1.1 26 static JSTaggedValue NumberConstructor(EcmaRuntimeCallInfo *argv); 27 28 // 20.1.2.2 29 static JSTaggedValue IsFinite(EcmaRuntimeCallInfo *argv); 30 // 20.1.2.3 31 static JSTaggedValue IsInteger(EcmaRuntimeCallInfo *argv); 32 // 20.1.2.4 33 static JSTaggedValue IsNaN(EcmaRuntimeCallInfo *argv); 34 // 20.1.2.5 35 static JSTaggedValue IsSafeInteger(EcmaRuntimeCallInfo *argv); 36 // 20.1.2.12 37 static JSTaggedValue ParseFloat(EcmaRuntimeCallInfo *argv); 38 // 20.1.2.13 39 static JSTaggedValue ParseInt(EcmaRuntimeCallInfo *argv); 40 41 // prototype 42 // 20.1.3.2 43 static JSTaggedValue ToExponential(EcmaRuntimeCallInfo *argv); 44 // 20.1.3.3 45 static JSTaggedValue ToFixed(EcmaRuntimeCallInfo *argv); 46 // 20.1.3.4 47 static JSTaggedValue ToLocaleString(EcmaRuntimeCallInfo *argv); 48 // 20.1.3.5 49 static JSTaggedValue ToPrecision(EcmaRuntimeCallInfo *argv); 50 // 20.1.3.6 51 static JSTaggedValue ToString(EcmaRuntimeCallInfo *argv); 52 // 20.1.3.7 53 static JSTaggedValue ValueOf(EcmaRuntimeCallInfo *argv); 54 55 private: 56 static JSTaggedNumber ThisNumberValue(JSThread *thread, EcmaRuntimeCallInfo *argv); 57 }; 58 } // namespace panda::ecmascript::builtins 59 #endif // ECMASCRIPT_BUILTINS_BUILTINS_NUBMER_H 60