From fa7ccc347335799124cd35910b6f0cba7f484506 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 9 Nov 2011 17:56:27 +0100 Subject: [PATCH] fix browser tests --- lib/ace/ext/static_highlight_test.js | 8 +++++- lib/ace/mode/javascript_worker.js | 37 ++++++++++++++++++++++++++++ lib/ace/narcissus/jslex.js | 2 +- lib/ace/narcissus/jsparse.js | 2 +- lib/ace/test/all_browser.js | 6 ++++- lib/ace/test/asyncjs/index.js | 1 + 6 files changed, 52 insertions(+), 4 deletions(-) diff --git a/lib/ace/ext/static_highlight_test.js b/lib/ace/ext/static_highlight_test.js index bba4b539..6b136a1e 100644 --- a/lib/ace/ext/static_highlight_test.js +++ b/lib/ace/ext/static_highlight_test.js @@ -3,6 +3,8 @@ if (typeof process !== "undefined") { require("../test/mockdom"); } +define(function(require, exports, module) { + var assert = require("assert"); var highlighter = require("./static_highlight"); var JavaScriptMode = require("../mode/javascript").Mode; @@ -71,4 +73,8 @@ function hello (a, b, c) {\n\ } }; -!module.parent && require("asyncjs").test.testcase(module.exports).exec(); +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec(); +} \ No newline at end of file diff --git a/lib/ace/mode/javascript_worker.js b/lib/ace/mode/javascript_worker.js index 3fb906d0..e6b6fad5 100644 --- a/lib/ace/mode/javascript_worker.js +++ b/lib/ace/mode/javascript_worker.js @@ -1,3 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { var oop = require("../lib/oop"); diff --git a/lib/ace/narcissus/jslex.js b/lib/ace/narcissus/jslex.js index ce561f55..f19bb274 100644 --- a/lib/ace/narcissus/jslex.js +++ b/lib/ace/narcissus/jslex.js @@ -544,6 +544,6 @@ }; - return { Tokenizer: Tokenizer }; + module.exports = { Tokenizer: Tokenizer }; }); diff --git a/lib/ace/narcissus/jsparse.js b/lib/ace/narcissus/jsparse.js index c431f191..9e0ee7c2 100644 --- a/lib/ace/narcissus/jsparse.js +++ b/lib/ace/narcissus/jsparse.js @@ -1892,7 +1892,7 @@ define(function(require, exports, module) { return n; } - return { + module.exports = { parse: parse, parseStdin: parseStdin, Node: Node, diff --git a/lib/ace/test/all_browser.js b/lib/ace/test/all_browser.js index d8ccdb82..feb4f28d 100644 --- a/lib/ace/test/all_browser.js +++ b/lib/ace/test/all_browser.js @@ -17,8 +17,12 @@ var tests = [ require("ace/editor_highlight_selected_word_test"), require("ace/editor_navigation_test"), require("ace/editor_text_edit_test"), + require("ace/ext/static_highlight_test"), require("ace/layer/text_test"), + require("ace/lib/event_emitter_test"), require("ace/mode/coffee/parser_test"), + require("ace/mode/coffee_tokenizer_test"), + require("ace/mode/coldfusion_test"), require("ace/mode/css_test"), require("ace/mode/css_tokenizer_test"), require("ace/mode/css_worker"), @@ -27,6 +31,7 @@ var tests = [ require("ace/mode/javascript_test"), require("ace/mode/javascript_tokenizer_test"), require("ace/mode/javascript_worker_test"), + require("ace/mode/python_test"), require("ace/mode/ruby_tokenizer_test"), require("ace/mode/text_test"), require("ace/mode/xml_test"), @@ -34,7 +39,6 @@ var tests = [ require("ace/range_test"), require("ace/search_test"), require("ace/selection_test"), - require("ace/test/event_emitter_test"), require("ace/virtual_renderer_test") ] diff --git a/lib/ace/test/asyncjs/index.js b/lib/ace/test/asyncjs/index.js index 6903fff4..8adee620 100644 --- a/lib/ace/test/asyncjs/index.js +++ b/lib/ace/test/asyncjs/index.js @@ -7,6 +7,7 @@ define(function(require, exports, module) { module.exports = require("./async") +module.exports.test = require("./test") require("./utils") }) \ No newline at end of file