Browse Source

Merge pull request #1184 from flyover/flyover-patch-1

allow node.createJSComponent without extension
JoshEngebretson 9 years ago
parent
commit
ab0157e490
1 changed files with 4 additions and 0 deletions
  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);
     String path = duk_require_string(ctx, 0);
 
 
+    if (Atomic::GetExtension(path).Empty()) {
+        path += ".js";
+    }
+
     bool hasArgs = false;
     bool hasArgs = false;
     int argIdx = -1;
     int argIdx = -1;
     if (duk_get_top(ctx) > 1 && duk_is_object(ctx, 1))
     if (duk_get_top(ctx) > 1 && duk_is_object(ctx, 1))