CCF
Loading...
Searching...
No Matches
constants.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include <quickjs/quickjs.h>
6
7namespace ccf::js::core
8{
9 namespace constants
10 {
11// "compound literals are a C99-specific feature"
12// Used heavily by QuickJS, including in macros (such as
13// ccf::js::core::constants::Null). Rather than disabling throughout the code,
14// we replace those with const instances here
15#pragma clang diagnostic push
16#pragma clang diagnostic ignored "-Wc99-extensions"
17 static constexpr JSValue Null = JS_NULL;
18 static constexpr JSValue Undefined = JS_UNDEFINED;
19 static constexpr JSValue False = JS_FALSE;
20 static constexpr JSValue True = JS_TRUE;
21 static constexpr JSValue Exception = JS_EXCEPTION;
22#pragma clang diagnostic pop
23 }
24}
Definition constants.h:8