Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting V8ScriptCompilationException while calling TestCafe script #426

Closed
anandxp opened this issue Oct 18, 2018 · 2 comments
Closed

Getting V8ScriptCompilationException while calling TestCafe script #426

anandxp opened this issue Oct 18, 2018 · 2 comments

Comments

@anandxp
Copy link

anandxp commented Oct 18, 2018

Error StackTrace

Exception in thread "main" undefined:1: SyntaxError: Unexpected reserved word
import { Selector } from 'testcafe';
^^^^^^
com.eclipsesource.v8.V8ScriptCompilationException
	at com.eclipsesource.v8.V8._executeIntegerScript(Native Method)
	at com.eclipsesource.v8.V8.executeIntegerScript(V8.java:911)
	at com.eclipsesource.v8.V8.executeIntegerScript(V8.java:436)
	at com.eclipsesource.v8.V8.executeIntegerScript(V8.java:418)
	at com.js.javatojs.FirstProgram.main(FirstProgram.java:16)

Program :

import com.eclipsesource.v8.V8;

public class FirstProgram {

	public static void main(String[] args) {
		 V8  runtime = V8.createV8Runtime();
		 int result = runtime.executeIntegerScript(""
				 + "import { Selector } from 'testcafe';\n"
				 + "fixture `Getting Started`\n"
		         + ".page `http://devexpress.github.io/testcafe/example`;\n");
		 
		 System.out.println(result);
		 runtime.release();
		 
	}
}

@anandxp
Copy link
Author

anandxp commented Nov 15, 2018

Any update on this bug ?

@irbull
Copy link
Member

irbull commented Jan 16, 2019

The version of V8 (node) we are targetting does include this. There is an open issue to update the underlying V8 version. See #334. Looks like you can use babel to transpile [1]

[1] https://stackoverflow.com/questions/32346886/unexpected-reserved-word-import-in-node-js

@irbull irbull closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants