diff --git a/demo/static-highlighter/server.js b/demo/static-highlighter/server.js index 52a52744..0571c8f8 100644 --- a/demo/static-highlighter/server.js +++ b/demo/static-highlighter/server.js @@ -20,8 +20,7 @@ var theme = require("../../lib/ace/theme/twilight"); var port = process.env.PORT || 2222; http.createServer(function(req, res) { - res.writeHead(200, {"Content-Type": "text/html"}); - + res.writeHead(200, {"Content-Type": "text/html; charset=utf-8"}); fs.readFile(__filename, "utf8", function(err, data) { var highlighted = highlighter.render(data, new JavaScriptMode(), theme); res.end('\n\ diff --git a/index.html b/index.html index 0b15dbba..5b09d666 100644 --- a/index.html +++ b/index.html @@ -967,6 +967,11 @@ oop.inherits(FoldMode, BaseFoldMode); Chocolatejs +
  • + + MultiPlay.io +
  • Sky Edit
  • diff --git a/lib/ace/editor.js b/lib/ace/editor.js index aaacbf46..049f63d8 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -344,8 +344,8 @@ var Editor = function(renderer, session) { * Gets the current font size of the editor text. */ this.getFontSize = function () { - return this.setOption("fontSize") || - dom.computedStyle(ace.container, "fontSize") + return this.getOption("fontSize") || + dom.computedStyle(this.container, "fontSize"); }; /** diff --git a/lib/ace/mode/coffee/parser_test.js b/lib/ace/mode/coffee/parser_test.js index a3082bd6..e4ccf1bb 100644 --- a/lib/ace/mode/coffee/parser_test.js +++ b/lib/ace/mode/coffee/parser_test.js @@ -45,35 +45,39 @@ function assertLocation(e, sl, sc, el, ec) { assert.equal(e.location.last_column, ec); } +function parse(str) { + try { + coffee.parse(str).compile(); + } catch (e) { + return e; + } +} + module.exports = { "test parse valid coffee script": function() { coffee.parse("square = (x) -> x * x"); }, "test parse invalid coffee script": function() { - try { - coffee.parse("a = 12 f"); - } catch (e) { - assert.equal(e.message, "Unexpected 'IDENTIFIER'"); - assertLocation(e, 0, 4, 0, 5); - } + var e = parse("a = 12 f"); + assert.equal(e.message, "Unexpected 'IDENTIFIER'"); + assertLocation(e, 0, 4, 0, 5); }, "test parse missing bracket": function() { - try { - coffee.parse("a = 12 f {\n\n"); - } catch (e) { - assert.equal(e.message, "missing }"); - assertLocation(e, 0, 10, 0, 10); - } + var e = parse("a = 12 f {\n\n"); + assert.equal(e.message, "missing }"); + assertLocation(e, 0, 10, 0, 10); }, "test unexpected indent": function() { - try { - coffee.parse("a\n a\n"); - } catch (e) { - assert.equal(e.message, "Unexpected 'INDENT'"); - assertLocation(e, 0, 0, 0, 0); - } + var e = parse("a\n a\n"); + assert.equal(e.message, "Unexpected 'INDENT'"); + assertLocation(e, 0, 0, 0, 0); + }, + "test invalid destructuring": function() { + var e = parse("\n{b: 5} = {}"); + assert.equal(e.message, '"5" cannot be assigned'); + assertLocation(e, 1, 4, 1, 4); } }; diff --git a/lib/ace/mode/coffee_worker.js b/lib/ace/mode/coffee_worker.js index f22640de..a5f700f8 100644 --- a/lib/ace/mode/coffee_worker.js +++ b/lib/ace/mode/coffee_worker.js @@ -40,7 +40,7 @@ window.addEventListener = function() {}; var Worker = exports.Worker = function(sender) { Mirror.call(this, sender); - this.setTimeout(200); + this.setTimeout(250); }; oop.inherits(Worker, Mirror); @@ -51,7 +51,7 @@ oop.inherits(Worker, Mirror); var value = this.doc.getValue(); try { - coffee.parse(value); + coffee.parse(value).compile(); } catch(e) { var loc = e.location; if (loc) { diff --git a/tool/perf-test.html b/tool/perf-test.html index 451c1b8a..ee8f6d0f 100644 --- a/tool/perf-test.html +++ b/tool/perf-test.html @@ -10,9 +10,13 @@ +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    @@ -78,8 +82,11 @@ + + + @@ -95,7 +102,7 @@ - + @@ -109,8 +116,10 @@ + + @@ -238,14 +247,54 @@ - + +
    + + + +
    + + + +
    + + + +
    + + + +
    +
    + +
    +
    -
    +