1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef builtin_TestingFunctions_h
8 #define builtin_TestingFunctions_h
10 #include "NamespaceImports.h" // JSContext, JSFunction, HandleObject, HandleValue, Value
14 [[nodiscard
]] bool InitTestingFunctions();
16 [[nodiscard
]] bool DefineTestingFunctions(JSContext
* cx
, HandleObject obj
,
18 bool disableOOMFunctions
);
20 [[nodiscard
]] bool testingFunc_assertFloat32(JSContext
* cx
, unsigned argc
,
23 [[nodiscard
]] bool testingFunc_assertRecoveredOnBailout(JSContext
* cx
,
27 [[nodiscard
]] bool testingFunc_serialize(JSContext
* cx
, unsigned argc
,
30 extern JSScript
* TestingFunctionArgumentToScript(JSContext
* cx
, HandleValue v
,
31 JSFunction
** funp
= nullptr);
33 #ifdef FUZZING_JS_FUZZILLI
34 uint32_t FuzzilliHashDouble(double value
);
36 uint32_t FuzzilliHashBigInt(BigInt
* bigInt
);
38 void FuzzilliHashObjectInl(JSContext
* cx
, JSObject
* obj
, uint32_t* out
);
39 void FuzzilliHashObject(JSContext
* cx
, JSObject
* obj
);
44 #endif /* builtin_TestingFunctions_h */