J2V8 icon indicating copy to clipboard operation
J2V8 copied to clipboard

The New version of J2V8(Android) can not support ES6 Import/Export function.....

Open byteuser opened this issue 8 years ago • 6 comments

import * from './function'; function aaa(){ for(let i=1;i<100;i++){ System.println("锟斤拷锟?====="+i); } return 0; } var a=System.getScreenResolution(); System.println("Screen======"+a); aaa();

undefined:2: SyntaxError: Unexpected token import import * from './function'; ^^^^^^

byteuser avatar Nov 02 '16 03:11 byteuser

Not even the latests node supports es6 modules yet, and it will probably take a while. You will need to transpile your code before running it anywhere in node.

diervo avatar Nov 23 '16 18:11 diervo

Actually an earlier version of V8 supported es6 modules with a flag but it got removed. That might be the cause of this problem.

Haringat avatar Mar 13 '17 01:03 Haringat

Does it support ES6 now?

vtahlani avatar Jun 14 '17 12:06 vtahlani

Does it support ES6 now?

Gaubee avatar Jun 18 '20 06:06 Gaubee

@Gaubee yes, the current version of V8 supports most of ES6 features

ahmadov avatar Jun 18 '20 14:06 ahmadov

latest v8 version support es module,plz add it to j2v8

wjljack avatar Jul 14 '21 08:07 wjljack