1### About profile files 2 3Specify compile definitions in profile files to use when compiling the `jerry-core` target. 4 5The default profile is ``es5.1`` which disables the ES2015 features. 6 7### Using profiles with the build system 8 9You can specify the profile for the build system in the following ways: 10 * with absolute path 11 * with a name (this options selects profiles/$(name).profile file) 12 13#### Restrictions 14Only single line options are allowed in the profile file. Any line starting with hash-mark is ignored. Semicolon character is not allowed. 15 16 17### Example usage 18 19#### 1. Using the build script 20 21If you want to use a predefined profile, run the build script as follows 22(assuming that you are in the project root folder): 23 24``` 25./tools/build.py --profile=minimal 26``` 27 28Alternatively, if you want to use a custom profile at 29`/absolute/path/to/my.profile`: 30 31``` 32# Turn off every ES2015 feature EXCEPT the module system 33JERRY_ES2015_BUILTIN_DATAVIEW=0 34JERRY_ES2015_BUILTIN_MAP=0 35JERRY_ES2015_BUILTIN_PROMISE=0 36JERRY_ES2015_BUILTIN_SET=0 37JERRY_ES2015_BUILTIN_TYPEDARRAY=0 38``` 39 40Run the build script as follows (assuming that you are in the project root 41folder): 42 43``` 44./tools/build.py --profile=/absolute/path/to/my.profile 45``` 46 47 48#### 2. Using only CMake build system 49 50Set FEATURE_PROFILE option to one of the following values: 51* the profile with absolute path 52* name of the profile (which needs to exist in the `profiles` folder) 53 54 55### Configurations 56 57In JerryScript all of the features are enabled by default, so an empty profile file turns on all of the available ECMA features. 58The 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 59defined to `1`. 60 61#### ES 5.1 features 62 63* `JERRY_BUILTIN_ANNEXB`: 64 Enables or disables the [Annex B](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-B) of the ECMA5.1 standard. 65* `JERRY_BUILTIN_ARRAY`: 66 Enables or disable the [Array](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.4) built-in. 67* `JERRY_BUILTIN_BOOLEAN`: 68 Enables or disables the [Boolean](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.6) built-in. 69* `JERRY_BUILTIN_DATE`: 70 Enables or disables the [Date](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.9) built-in. 71* `JERRY_BUILTIN_ERRORS`: 72 Enables or disables the [Native Error Types](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.11.6) (EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError). 73 **Note**: The [Error](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.11.2) object remains available. 74* `JERRY_BUILTIN_JSON`: 75 Enables or disables the [JSON](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.12) built-in. 76* `JERRY_BUILTIN_MATH`: 77 Enables or disables the [Math](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.8) built-in. 78* `JERRY_BUILTIN_NUMBER`: 79 Enables or disables the [Number](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.7) built-in. 80* `JERRY_BUILTIN_REGEXP`: 81 Enables or disables the [RegExp](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.10) built-in. 82* `JERRY_BUILTIN_STRING`: 83 Enables or disables the [String](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.5) built-in. 84* `JERRY_BUILTINS`: 85 Enables or disable all of the [Standard Built-in ECMAScript 5.1 Objects](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15) 86 This option is evaulated first, any other `JERRY_BUILTIN_<name>` defines will override that specific builtin config. 87 Equivalent with setting the following defines to the `JERRY_BUILTINS` value: 88 * `JERRY_BUILTIN_ANNEXB` 89 * `JERRY_BUILTIN_ARRAY` 90 * `JERRY_BUILTIN_BOOLEAN` 91 * `JERRY_BUILTIN_DATE` 92 * `JERRY_BUILTIN_ERRORS` 93 * `JERRY_BUILTIN_JSON` 94 * `JERRY_BUILTIN_MATH` 95 * `JERRY_BUILTIN_NUMBER` 96 * `JERRY_BUILTIN_REGEXP` 97 * `JERRY_BUILTIN_STRING` 98 99#### ES6 (ES 2015) features 100 101* `JERRY_ES2015_BUILTIN_DATAVIEW`: 102 Enables or disables the [DataView](https://www.ecma-international.org/ecma-262/6.0/#sec-dataview-objects) built-in. 103* `JERRY_ES2015_BUILTIN_MAP`: 104 Enables or disables the [Map](http://www.ecma-international.org/ecma-262/6.0/#sec-keyed-collection) built-ins. 105* `JERRY_ES2015_BUILTIN_SET`: 106 Enables or disables the [SET](https://www.ecma-international.org/ecma-262/6.0/#sec-set-objects) built-in. 107* `JERRY_ES2015_BUILTIN_PROMISE`: 108 Enables or disables the [Promise](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects) built-in. 109* `JERRY_ES2015_BUILTIN_TYPEDARRAY`: 110 Enables or disables the [ArrayBuffer](http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-objects) and [TypedArray](http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects) built-ins. 111* `JERRY_ES2015_MODULE_SYSTEM`: 112 Enables or disable the [module system](http://www.ecma-international.org/ecma-262/6.0/#sec-modules) language element. 113* `JERRY_ES2015`: Enables or disable all of the implemented [ECMAScript2015 features](http://www.ecma-international.org/ecma-262/6.0/). 114 * [arrow functions](http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions) language element. 115 * [class](https://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions) language element. 116 * [default value](http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions) for formal parameters. 117 * [destructuring assignment](http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment) language element. 118 * [destructuring binding pattern](http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-binding-patterns) declarations. 119 * [enhanced object initializer](http://www.ecma-international.org/ecma-262/6.0/#sec-object-initializer) language element. 120 * [for-of](https://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements) language element. 121 * [generator functions](http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions) language element. 122 * [iterator](https://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) built-in. 123 * [rest parameter](http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions) language element. 124 * [symbol](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects) language element. 125 * [template strings](http://www.ecma-international.org/ecma-262/6.0/#sec-static-semantics-templatestrings) language element. 126 Furthermore all builtins follow the ES2015 specification including those which behave differently in ES5.1. 127 This option is evaulated first, any other `JERRY_ES2015_<name>` defines will override that specific entry. 128 Equivalent with setting the following defines to the `JERRY_ES2015` value: 129 * `JERRY_ES2015_BUILTIN_DATAVIEW` 130 * `JERRY_ES2015_BUILTIN_MAP` 131 * `JERRY_ES2015_BUILTIN_SET` 132 * `JERRY_ES2015_BUILTIN_PROMISE` 133 * `JERRY_ES2015_BUILTIN_TYPEDARRAY` 134 * `JERRY_ES2015_MODULE_SYSTEM` 135 136