Comparing version 4.3.11 to 4.4.0
# Changelog | ||
## v4.4.0 | ||
- Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining. | ||
## v4.3.11 | ||
@@ -4,0 +8,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "4.3.11", | ||
"version": "4.4.0", | ||
"engines": { | ||
@@ -10,0 +10,0 @@ "node": ">=6.0.0" |
@@ -1195,2 +1195,26 @@ <h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1> | ||
### Annotations | ||
Annotations in Terser are a way to tell it to treat a certain function call differently. The following annotations are available: | ||
* `/*@__INLINE__*/` - forces a function to be inlined somewhere. | ||
* `/*@__NOINLINE__*/` - Makes sure the called function is not inlined into the call site. | ||
* `/*@__PURE__*/` - Marks a function call as pure. That means, it can safely be dropped. | ||
You can use either a `@` sign at the start, or a `#`. | ||
Here are some examples on how to use them: | ||
```javascript | ||
/*@__INLINE__*/ | ||
function_always_inlined_here() | ||
/*#__NOINLINE__*/ | ||
function_cant_be_inlined_into_here() | ||
const x = /*#__PURE__*/i_am_dropped_if_x_is_not_used() | ||
``` | ||
### Working with Terser AST | ||
@@ -1197,0 +1221,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1714237
7623
1380