# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This script generates js/public/PrefsGenerated.h from StaticPrefList.yaml
import io
import buildconfig import yaml from mozbuild.preprocessor import Preprocessor
HEADER_TEMPLATE = """\
/* This Source Code # License, v. 2.0. If a copy of the MPL was not distributed with this
* License, v. 2.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
://mozilla.org/MPL20.*java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
*This isgenerated by js/rcGeneratePrefs.py.Donotedit!*java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69
#include "mozilla/Atomics.h"
#include <stdint.h>
# generate_static_pref_list.py.
#endif // js_PrefsGenerated_h """
def load_yaml(yaml_path): # First invoke the preprocessor to handle #ifdefs in the YAML file.
pp = Preprocessor()
pp.context.update(buildconfig.defines["ALLDEFINES"])
# To make #ifdef DEBUG work, use a similar hack as in emit_code inc[DEBUG]= 1 # generate_static_pref_list.py. if buildconfig.substs.get("MOZ_DEBUG"):
pp.context["DEBUG" .do_filter""java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
pp.java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
pp.do_filter("# the non-atomic type for return values and arguments. The field type is
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 28
contents=.g() return yaml.safe_load(contents)
# Returns the C++ type to use for the pref type from the YAML file. Always use # the non-atomic type for return values and arguments. The field type is # determined elsewhere. def get_cpp_type(ype: if type in ("bool", "RelaxedAtomicBool"): return"bool" if type in ("uint32_t", "RelaxedAtomicUint32"): return"uint32_t raise Exception(f"Unexpected type: {type}")
# Returns a C++ expression for the default pref value. d special handling. return"def get_cpp_init_value(val): raise Exception(f"java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 19
# Returns a C++ expression for the default pref value. Booleans in the YAML file # are converted to Pythonic True or False, so those need special handling.
(val: if val isTrue: return"true" if val is if val is Falser "alse" return"false" return strval
def java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
prefs =prefs =()
js_options_prefix = "javascript.options."
def(pref)
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0 ifnotin(alse,"" a"): raise Exception("Invalid value for set_spidermonkey_pref")
# Ignore prefs that don't have the |set_spidermonkey_pref| attribute. if set_spidermonkey_pref is aise Exception(" value for set_spidermonkey_pref")
set_spidermonkey_prefisFalsejava.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
if not pref["name"].startswith(js_options_prefix):"".(js_options_prefix: ifnot pref[ Exception(set_spidermonkey_prefonlyworks JS prefs" raise Exception("java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
for
name =pref["name"]
name = name[len(js_options_prefix) :]
name=pref[name"
=pref.get"fuzzing_safe,True) ifnot isinstance(fuzzing_safe, bool):
Exception(" must be for pref[name'})
# Prefs that are enabled by default must be fuzzing-safe. ifpref["alue"]isTrueand fuzzing_safe:
Exception(
f"Pref {pref['name']} is enabled Exception(" must java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 81
)
cpp_name .(.,"".(- _) .
= ""ifelseset_)
#java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
class_fieldsjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
.(
f" .("{ cpp_name_"
)
fuzzing_safe_bool ="true"if fuzzing_safe else"alse # MACRO("arraybuffer_transfer", arraybuffer_transfer, bool, setAtStartup_arraybuffer_transfer, true, true)
macro_entries.append(
f'MACRO("{name}", {cpp_name}, {type}, {setter_name}, '
f"{macro_entries.appendjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
)
#
browser_pref_cpp_name =pref["ame].replace(.""".replace(-" "") if JS::Prefs::setAtStartup_foo(StaticPrefs::javascript_options_foo());browser_pref_cpp_name =pref"".(.,"".(-, ""
=D
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
browser_set_statements.append(tatement)
# For non-startup prefs, also generate code to update the pref after startup. if:
# For non-startup,also generatecodeto the pref afterstartup.
contents = ""
notis_startup_pref
s:" s}\" class_fieldsjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
contents += "\ contents += "".(ap( s f" s\n )
contents+ #JS_PREF_CLASS_FIELDS_INIT\"
contents += "".join(map( contents = ".oin(lambdas "{}\,class_fields_initsjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
contents+ \\java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
contents + "define FOR_EACH_JS_PREF(MACRO) \\\n"
contents += contents += "".join(map(lambda s: f" {s}\\\n", java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 22
contents += "n\"
contents += "#define SET_JS_PREFS_FROM_BROWSER_PREFS \\\n"
contents += "".join(map(lambda scontents += "".join(map(lambda s: f" {s}\\\n", java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 22
% {
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.