Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Issues
  • #743
Closed
Open
Issue created Sep 15, 2017 by Kapil Kanwar@glaba

Errors with valid ES6 import syntax

This results in an error:

module.js

export syntax hi = function(ctx) {
    return #`console.log('hello, world!')`;
}

file2.js

export const TEST = 3;

file.js

import { hi } from "./module.js";
import * as Test from "./file2.js";
hi;

Running sjs file.js results in

/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/token_stream.js:95
      var rightChar = tokenStr.charAt(0);
                               ^

TypeError: tokenStr.charAt is not a function
    at TokenStream.put (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/token_stream.js:95:32)
    at Token.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:247:10)
    at /usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:444:19
    at Array.forEach (native)
    at Seq.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:443:21)
    at /usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:444:19
    at Array.forEach (native)
    at Seq.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:443:21)
    at codeGen (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/index.js:153:7)
    at codegen (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/codegen.js:16:38)
Assignee
Assign to
Time tracking