فهرست منبع

Protect the compile of inspector fields, disable JS editor autocomplete until there is time to look into it

Josh Engebretson 10 سال پیش
والد
کامیت
c545cc8a7d
2فایلهای تغییر یافته به همراه13 افزوده شده و 3 حذف شده
  1. 3 1
      Source/AtomicEditorWork/Editors/JSResourceEditor.cpp
  2. 10 2
      Source/AtomicJS/Javascript/JSComponentFile.cpp

+ 3 - 1
Source/AtomicEditorWork/Editors/JSResourceEditor.cpp

@@ -239,7 +239,9 @@ void JSResourceEditor::OnChange(TBStyleEdit* styleEdit)
         if (hasCompletions)
         {
             autocomplete_->SetPosition(TBPoint(fragment->xpos, (styleEdit_->caret.y - styleEdit_->scroll_y) + fragment->line_height));
-            autocomplete_->Show();
+
+            // autocomplete disabled until it can be looked at
+            //autocomplete_->Show();
         }
     }
 

+ 10 - 2
Source/AtomicJS/Javascript/JSComponentFile.cpp

@@ -287,8 +287,16 @@ bool JSComponentFile::BeginLoad(Deserializer& source)
 
         duk_push_string(ctx, eval.CString());
         duk_push_string(ctx, "eval");
-        duk_compile(ctx, DUK_COMPILE_EVAL);
-        if (duk_is_function(ctx, -1) && duk_pcall(ctx, 0) == DUK_EXEC_SUCCESS)
+
+        if (duk_pcompile(ctx, DUK_COMPILE_EVAL) != 0)
+        {
+
+            // couldn't eval the inspector fields
+            duk_set_top(ctx, top);
+            return true;
+
+        }
+        else if (duk_is_function(ctx, -1) && duk_pcall(ctx, 0) == DUK_EXEC_SUCCESS)
         {
             if (duk_is_object(ctx, -1))
             {