Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix modecreator

  • Loading branch information...
commit cf9ef326ae04da6bb9f5d1cd3777b053b060a3c0 1 parent 5a5439f
@nightwing nightwing authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 tool/mode_creator.js
View
19 tool/mode_creator.js
@@ -145,15 +145,20 @@ function run() {
var src = editor1.getValue();
var path = "ace/mode/new";
var deps = getDeps(src, path);
- src = src.replace("define(", 'define("' + path +'", ["require","exports","module",' + deps +'],');
- src += ';require(["ace/mode/new"], function(e) {\
- try{continueRun(e)}catch(e){log(e)}\
- }, function(e){\
- log(e);\
- window.require.undef("ace/mode/new")\
- });';
+ window.require.undef(path)
+ src = src.replace("define(", 'define("' + path +'", ["require","exports","module",' + deps +'],');
try {
eval(src);
+ require(["ace/mode/new"], function(e) {
+ try{
+ continueRun(e)
+ }catch(e){
+ log(e)
+ }
+ }, function(e) {
+ log(e);
+ window.require.undef(path)
+ });
hideLog()
} catch(e) {
log(e);
Please sign in to comment.
Something went wrong with that request. Please try again.