How do I use the V8 engine?
The V8 engine was introduced in EmEditor v22.1.0.
- Go to Macros | Customize… and open the Options page
- Check Use V8 as JavaScript engine and click OK
You can also programmatically specify the engine with this line at the top of your macro:
#language = "v8"
or
#language = "JScript"
JScript compatibility with V8
Method and property identifiers are case-sensitive in V8, unlike JScript. For example, if you wrote redraw = false
, in V8 you will need to fix the case to be Redraw = false
.
V8 does not support ActiveXObject, but for commonly used methods, you can use the following methods of the Shell object included in EmEditor macros instead:
Run
, FileExists
, FolderExists
, DeleteFile
, DeleteFolder
, CreateFolder
, GetFileAttributes
, and SetFileAttributes
.
Web API limitations
Certain Web APIs are unavailable on V8, such as import
, fetch
, and DOM manipulation.