Permalink
Browse files

fix modecreator

  • Loading branch information...
1 parent 5a5439f commit cf9ef326ae04da6bb9f5d1cd3777b053b060a3c0 @nightwing nightwing committed Apr 17, 2013
Showing with 12 additions and 7 deletions.
  1. +12 −7 tool/mode_creator.js
View
@@ -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);

0 comments on commit cf9ef32

Please sign in to comment.