Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Add -jpike prefix and fix for latest esprima-harmony.
Browse files Browse the repository at this point in the history
  • Loading branch information
insidewhy committed Jan 13, 2013
1 parent 69bb9f9 commit c40298c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions extras/six.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(global) {var Six = function() {function require(path){ return require[path] || {}; } require["esprima-six"] = new function(){ var exports = this; /*
(function(global) {var Six = function() {function require(path){ return require[path] || {}; } require["esprima-six-jpike"] = new function(){ var exports = this; /*
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
Expand Down Expand Up @@ -8218,4 +8218,4 @@ var runScripts = function () {
if (window.addEventListener)
window.addEventListener("DOMContentLoaded", runScripts, false);
else
window.attachEvent("onload", runScripts); }; return require["./six"];}();if (typeof define === "function" && define.amd) {define(function() { return Six; });} else {global.Six = Six;}}(typeof global !== "undefined" ? global : this));
window.attachEvent("onload", runScripts); }; return require["./six"];}();if (typeof define === "function" && define.amd) {define(function() { return Six; });} else {global.Six = Six;}}(typeof global !== "undefined" ? global : this));
2 changes: 1 addition & 1 deletion lib/esom/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (typeof exports === 'object' && typeof define !== 'function') {
};
}
define(function (require, exports) {
var esprima = require("esprima-six");
var esprima = require("esprima-six-jpike");
var parse = esprima.parse;
var Syntax = esprima.Syntax;
var Tree = function () {
Expand Down
4 changes: 2 additions & 2 deletions lib/rewriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ define(function (require, exports) {
};
Object.define(Tree.prototype, {
compile: function () {
var src = this.raw();
var src = typeof this.raw === "function" ? this.raw() : this.raw;
this.children.reverse().forEach(function (child) {
var raw = child.raw();
var raw = typeof child.raw === "function" ? child.raw() : child.raw;
var start = src.indexOf(raw);
var end = start + raw.length;
src = src.substring(0, start) + child.compile() + src.substring(end);
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name" : "six",
"name" : "six-jpike",
"description" : "JavaScript you can bet on.",
"keywords" : ["javascript", "language", "six", "compiler"],
"author" : "Matthew Robb",
Expand All @@ -20,7 +20,7 @@
"url" : "git://github.com/matthewrobb/six.git"
},
"dependencies": {
"esprima-six": "",
"esprima-six-jpike": "",
"escodegen": ""
},
"devDependencies" : {
Expand All @@ -33,4 +33,4 @@
"scripts": {
"test": "node node_modules/mocha/bin/mocha"
}
}
}
2 changes: 1 addition & 1 deletion src/esom/tree.six
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module esprima = "esprima-six";
module esprima = "esprima-six-jpike";

var parse = esprima.parse;
var Syntax = esprima.Syntax;
Expand Down
4 changes: 2 additions & 2 deletions src/rewriter.six
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export function rewrite(src, options) {
Object.define(Tree.prototype, {

compile () {
var src = this.raw()
var src = typeof this.raw === "function" ? this.raw() : this.raw

this.children.reverse().forEach(child => {
var raw = child.raw()
var raw = typeof child.raw === "function" ? child.raw() : child.raw
var start = src.indexOf(raw)
var end = start + raw.length
src = src.substring(0, start) + child.compile() + src.substring(end)
Expand Down

0 comments on commit c40298c

Please sign in to comment.