0
votes

I download this project: https://github.com/Tasarinan/editor-framework

I follow all steps: 1) I install Polymer and Electron (and other: phyton, nodejs ecc.) 2) Run all commands: sh utils/npm.sh install bower install gulp update-electron sh utils/install-builtin.sh sh demo.sh

The project run fine, but when I open the Grid Panel I have this error: Uncaught SyntaxError: Unexpected token ) (line 1) Uncaught SyntaxError: Unexpected token ) (line 28) ecc.

(() => { // (line 1)

//*************************
  Editor.polymerElement({
    properties: {
      debugInfo: {
        type: Object,
        value: () => { return {  // (Line 28)
          xAxisScale: 0,
          xMinLevel: 0,
          xMaxLevel: 0,
          yAxisScale: 0,
          yMinLevel: 0,
          yMaxLevel: 0,
        }; },
      },

This is the link of the code: https://github.com/cocos-creator-packages/ui-grid/blob/master/widget/pixi-grid.js

I don't understand these commands ()=>{} What library I have to add??

Sorry for my bad english and thanks for Help.

1

1 Answers

0
votes

Code ()=>{} is from new version of Javascript (ES6) called arrow functions

() => {} == function() {}

Some of the browsers doesn't support new version of javascript and you have to use polyfills. For example if you are using IE you won't be able to see that page.

Polymer has Polymer-cli that has built-in Polymer build command which can transform code into older version of javascript so all browsers can read the code.

Try to open the project in Chrome (fastest browser for such things like HTML imports)