- AuthorPosts
- May 23, 2025 at 2:58 am #30245
Patrick C
ParticipantContext
Before the V8 engine, variables could only be declared withvar.
V8 adds declaration withconstandlet.Issue
jseeFile1
jseeFile2←#include jseeFile1
jseeFile3←#include jseeFile1,#include jseeFile2In
jseeFile3EmEditor’s#includedirective is smart enough not to includejseeFile1twice, but only with respect to declarations withfunctionandvar.It appears that EmEditor’s
#includedirective has not yet been updated to treat declarations withconstandletthe same way as it treatsvar.Detailed example
jseeFile1_params.jsee#language = "V8" #async = "off" var defaultVal = "Hello!"; // «const» & «let» fail; «var» worksjseeFile2_functions.jsee
#language = "V8" #async = "off" #include "jseeFile1_params.jsee" function greet(greeting = defaultVal) { alert(greeting); }jseeFile3_main.jsee
#language = "V8" #async = "off" #include "jseeFile1_params.jsee" #include "jseeFile2_functions.jsee" status = "defaultVal = " + defaultVal; greet();In jseeFile1_params.jsee
Changingvar defaultVal = "Hello!";
Tolet defaultVal = "Hello!";
orconst defaultVal = "Hello!";
results in jseeFile3_main.jsee no longer working.In this simple example the workaround is to not include jseeFile1 in jseeFile3_main, but this can get tricky once the dependencies get more complex.
- AuthorPosts
- You must be logged in to reply to this topic.