How to use the traceur/src/node/traceur.syntax function in traceur

To help you get started, we’ve selected a few traceur examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thlorenz / es6ify / spikes / project-writer.js View on Github external
var traceur       =  require('traceur/src/node/traceur');
var ProjectWriter =  traceur.outputgeneration.ProjectWriter;
var project       =  new traceur.semantics.symbols.Project(url);

var url = 'http://some url';

var sourceA = 'var a = [...[0, 1]];';
var fileA = new traceur.syntax.SourceFile('a', sourceA);
project.addFile(fileA);

var sourceB = 'var b = [...a, 2];';
var fileB = new traceur.syntax.SourceFile('b', sourceB);
project.addFile(fileB);

var reporter = new traceur.util.ErrorReporter();

var res = traceur.codegeneration.Compiler.compile(reporter, project, false);

var actualResult = ProjectWriter.write(res);

console.log(actualResult);
github thlorenz / es6ify / spikes / project-writer.js View on Github external
var traceur       =  require('traceur/src/node/traceur');
var ProjectWriter =  traceur.outputgeneration.ProjectWriter;
var project       =  new traceur.semantics.symbols.Project(url);

var url = 'http://some url';

var sourceA = 'var a = [...[0, 1]];';
var fileA = new traceur.syntax.SourceFile('a', sourceA);
project.addFile(fileA);

var sourceB = 'var b = [...a, 2];';
var fileB = new traceur.syntax.SourceFile('b', sourceB);
project.addFile(fileB);

var reporter = new traceur.util.ErrorReporter();

var res = traceur.codegeneration.Compiler.compile(reporter, project, false);

var actualResult = ProjectWriter.write(res);

console.log(actualResult);