Opened 3 years ago

Last modified 2 years ago

#6448 new change

Consider the possibility to use ES6 modules

Reported by: sergz Assignee:
Priority: P4 Milestone:
Module: Libadblockplus Keywords:
Cc: mjethani Blocked By:
Blocking: #6447 Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by hfiguiere)


The issue #6447 implies the usage of the new syntax, however it also affects the loading mechanism, including such questions like what API should be used, how paths are resolved, what data can be passed around, etc. As the result of this issue we should be also aware about limitations of the current implementation of ES6 modules.

It seems there is already support of such functionality in V8 (,, though it can be not finished yet. At least in the currently used version of V8.

What to change

  • First of all switch to not deprecated API for v8::Script::Compile (see v8.h and CompileScript in JsEngine.cpp), one should use static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(Local<Context> context, Local<String> source, ScriptOrigin* origin = nullptr);. In order to support modules see how ScriptOrigin is used in some other projects (firstly check d8), e.g. mentioned in the v8 bug tracker,
  • Pay attention to class V8_EXPORT Module class (in v8.h), however firstly V8 should be updated.

Change History (3)

comment:1 Changed 3 years ago by sergz

  • Blocking 6447 added

comment:2 Changed 2 years ago by mjethani

I have closed #6447. We don't have time to work on this, nor is it a good time according to @agiammarchi.

comment:3 Changed 2 years ago by hfiguiere

  • Description modified (diff)
Note: See TracTickets for help on using tickets.