SyntaxError: Parse Error occurs only in safari

Im getting SyntaxError: Parse Error, only on safari. Here is the code.

<script type="text/javascript"> $(document).ready(function() { $("form").transload({ auth: {key: "b7deac9c96af6c745e914e25d0350baa"}, flow: { encode: { "use": ":original", "robot": "/video/encode", "preset": "flash", "width": 480, "height": 320 }, encode_iphone: { "use": ":original", "robot": "/video/encode", "preset": "iphone" }, export: { "use": ["encode","encode_iphone"], "robot": "/s3/store" } } }); }); </script> 

I am using the transloadit jquery plugin. which works on every other page and loads safari perfectly in appearance.

Errors are on line 44, which

 export: { 

Can someone see something wrong with this page?

+6
javascript jquery safari ruby-on-rails
source share
2 answers

The following words are used as keywords in the proposed extensions and are therefore reserved for future use of these extensions.

class enum extends export export super const

ECMAScript Language Specification , Section 7.6.1 Reserved Words

Other translators may be more liberal with regard to them, which may explain that it only gives a SyntaxError in the JavascriptCore (javascript Safari interpreter).

+9
source share

The word export is an ECMAScript future reserved word ; in some implementations, using these keywords as identifiers, SyntaxErrors is called.

However, you can just use a string literal, instead an identifier:

 //.... "export": { "use": ["encode","encode_iphone"], "robot": "/s3/store" } //.... 

This keyword may be used in the future for module declarations:

+6
source share

All Articles