Page 1 of 1

Unexpected Reserved Word - Server Script

Posted: Tue Mar 03, 2015 4:27 pm
by Dan7412167

When I try to write a server side script that includes the "import" command, such as:

import org.scribe.model.OAuthRequest;

I get the following error: "Unexpected reserved word ( @ 1 : 0 ) - import"

Is there some other way I should be writing this on this platform?

Thanks.


Unexpected Reserved Word - Server Script

Posted: Wed Mar 04, 2015 5:53 am
by Yurii Orishchuk

Hi Dan,

import directive not supported with v8 JS engine.

You can create your JS library and use it in the server script.

See details here: http://devcenter.appery.io/documentat...

Regards.


Unexpected Reserved Word - Server Script

Posted: Fri Mar 06, 2015 5:35 pm
by Dan7412167

The problem still when used in a library. I placed the import code into a library, run a script that uses it as a dependency, and it fails with the exact same error.


Unexpected Reserved Word - Server Script

Posted: Mon Mar 09, 2015 3:02 am
by Yurii Orishchuk

Hi Dan,

You don't need to use "import" directive...

So if your 3rd party code uses this directive you should alter this code.

Regards.


Unexpected Reserved Word - Server Script

Posted: Thu Mar 12, 2015 3:21 pm
by Dan7412167

Maybe I should qualify, I'm new to java programming, and app development in general. When you say alter the code, are you simply saying exclude it, or do I need to code it in a different way?


Unexpected Reserved Word - Server Script

Posted: Mon Mar 16, 2015 1:28 am
by Yurii Orishchuk

Hi Dan,

Unfortunatly you can not use this JS code in Appery.io server code without changes to fit it to V8 JS engine.

Regards.


Unexpected Reserved Word - Server Script

Posted: Mon Mar 16, 2015 3:42 pm
by Dan7412167

Ok, maybe I'm not understanding my options here. Will this simply not work? I'm trying to use some Yelp API code and if you're telling me I cant, I'll move on to another product.


Unexpected Reserved Word - Server Script

Posted: Wed Mar 18, 2015 4:08 am
by Yurii Orishchuk

Hi Dan,

Yes, you can not use this implementation in Appery.io server code.

May be it's better to use some REST API of this service?

Please read more about it here: https://www.yelp.com/developers/docum...

Regards.