Просмотр исходного кода

allow node.createJSComponent without extension

Isaac Burns 9 лет назад
Родитель
Сommit
5bbc6cde7f
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      Source/AtomicJS/Javascript/JSScene.cpp

+ 4 - 0
Source/AtomicJS/Javascript/JSScene.cpp

@@ -45,6 +45,10 @@ static int Node_CreateJSComponent(duk_context* ctx)
 {
     String path = duk_require_string(ctx, 0);
 
+    if (Atomic::GetExtension(path).Empty()) {
+        path += ".js";
+    }
+
     bool hasArgs = false;
     int argIdx = -1;
     if (duk_get_top(ctx) > 1 && duk_is_object(ctx, 1))