About profile files
Specify compile definitions in profile files to use when compiling the jerry-core target.
The default profile is es5.1 which disables the ES2015 features.
Using profiles with the build system
You can specify the profile for the build system in the following ways:
- with absolute path
- with a name (this options selects profiles/$(name).profile file)
Restrictions
Only single line options are allowed in the profile file. Any line starting with hash-mark is ignored. Semicolon character is not allowed.
Example usage
1. Using the build script
If you want to use a predefined profile, run the build script as follows (assuming that you are in the project root folder):
./tools/build.py --profile=minimal
Alternatively, if you want to use a custom profile at
/absolute/path/to/my.profile:
# Turn off every ES2015 feature EXCEPT the arrow functions
JERRY_ES2015_BUILTIN=0
JERRY_ES2015_BUILTIN_DATAVIEW=0
JERRY_ES2015_BUILTIN_ITERATOR=0
JERRY_ES2015_BUILTIN_MAP=0
JERRY_ES2015_BUILTIN_PROMISE=0
JERRY_ES2015_BUILTIN_SET=0
JERRY_ES2015_BUILTIN_SYMBOL=0
JERRY_ES2015_BUILTIN_TYPEDARRAY=0
JERRY_ES2015_CLASS=0
JERRY_ES2015_FOR_OF=0
JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER=0
JERRY_ES2015_FUNCTION_REST_PARAMETER=0
JERRY_ES2015_MODULE_SYSTEM=0
JERRY_ES2015_OBJECT_INITIALIZER=0
JERRY_ES2015_TEMPLATE_STRINGS=0
Run the build script as follows (assuming that you are in the project root folder):
./tools/build.py --profile=/absolute/path/to/my.profile
2. Using only CMake build system
Set FEATURE_PROFILE option to one of the following values:
- the profile with absolute path
- name of the profile (which needs to exist in the
profilesfolder)
Configurations
In JerryScript all of the features are enabled by default, so an empty profile file turns on all of the available ECMA features.
The defines can have a value of 0 or 1. If for whatever reason one of them are not defined, it is treated as if it were
defined to 1.
ES 5.1 features
JERRY_BUILTIN_ANNEXB: Enables or disables the Annex B of the ECMA5.1 standard.JERRY_BUILTIN_ARRAY: Enables or disable the Array built-in.JERRY_BUILTIN_BOOLEAN: Enables or disables the Boolean built-in.JERRY_BUILTIN_DATE: Enables or disables the Date built-in.JERRY_BUILTIN_ERRORS: Enables or disables the Native Error Types (EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError). Note: The Error object remains available.JERRY_BUILTIN_JSON: Enables or disables the JSON built-in.JERRY_BUILTIN_MATH: Enables or disables the Math built-in.JERRY_BUILTIN_NUMBER: Enables or disables the Number built-in.JERRY_BUILTIN_REGEXP: Enables or disables the RegExp built-in.JERRY_BUILTIN_STRING: Enables or disables the String built-in.JERRY_BUILTINS: Enables or disable all of the Standard Built-in ECMAScript 5.1 Objects This option is evaulated first, any otherJERRY_BUILTIN_<name>defines will override that specific builtin config. Equivalent with setting the following defines to theJERRY_BUILTINSvalue:JERRY_BUILTIN_ANNEXBJERRY_BUILTIN_ARRAYJERRY_BUILTIN_BOOLEANJERRY_BUILTIN_DATEJERRY_BUILTIN_ERRORSJERRY_BUILTIN_JSONJERRY_BUILTIN_MATHJERRY_BUILTIN_NUMBERJERRY_BUILTIN_REGEXPJERRY_BUILTIN_STRING
ES6 (ES 2015) features
JERRY_ES2015_ARROW_FUNCTION: Enables or disables the arrow functions.JERRY_ES2015_BUILTIN: Enables or disables the built-in updates of the 5.1 standard. There are some differences in those built-ins which available in both 5.1 and 2015 versions of the standard. JerryScript uses the latest definition by default.JERRY_ES2015_BUILTIN_DATAVIEW: Enables or disables the DataView built-in.JERRY_ES2015_BUILTIN_ITERATOR: Enables or disables the Iterator built-in.JERRY_ES2015_BUILTIN_MAP: Enables or disables the Map built-ins.JERRY_ES2015_BUILTIN_SET: Enables or disables the SET built-in.JERRY_ES2015_BUILTIN_SYMBOL: Enables or disables the Symbol built-in.JERRY_ES2015_BUILTIN_PROMISE: Enables or disables the Promise built-in.JERRY_ES2015_BUILTIN_TYPEDARRAY: Enables or disables the ArrayBuffer and TypedArray built-ins.JERRY_ES2015_CLASS: Enables or disables the class language element.JERRY_ES2015_FOR_OF: Enables or disables the for of language element.JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER: Enables or disables the default value for formal parameters.JERRY_ES2015_FUNCTION_REST_PARAMETER: Enables or disables the rest parameter.JERRY_ES2015_MODULE_SYSTEM: Enables or disable the module system language element.JERRY_ES2015_OBJECT_INITIALIZER: Enables or disables the enhanced object initializer language element.JERRY_ES2015_TEMPLATE_STRINGS: Enables or disables the template strings.JERRY_ES2015: Enables or disable all of the implemented ECMAScript2015 features. This option is evaulated first, any otherJERRY_ES2015_<name>defines will override that specific entry. Equivalent with setting the following defines to theJERRY_ES2015value:JERRY_ES2015_ARROW_FUNCTIONJERRY_ES2015_BUILTINJERRY_ES2015_BUILTIN_DATAVIEWJERRY_ES2015_BUILTIN_ITERATORJERRY_ES2015_BUILTIN_MAPJERRY_ES2015_BUILTIN_SETJERRY_ES2015_BUILTIN_PROMISEJERRY_ES2015_BUILTIN_SYMBOLJERRY_ES2015_BUILTIN_TYPEDARRAYJERRY_ES2015_CLASSJERRY_ES2015_FOR_OFJERRY_ES2015_FUNCTION_PARAMETER_INITIALIZERJERRY_ES2015_FUNCTION_REST_PARAMETERJERRY_ES2015_MODULE_SYSTEMJERRY_ES2015_OBJECT_INITIALIZERJERRY_ES2015_TEMPLATE_STRINGS