Browse Source

Remove the (double) casts and also add the @deprecated jsdoc tag for if/when TS intellisense honors it.

Shaddock Heath 9 years ago
parent
commit
0bcc3b2ac9

+ 1 - 1
Source/ToolCore/JSBind/JSBTypeScript.cpp

@@ -367,7 +367,7 @@ void JSBTypeScript::ExportModuleEnums(JSBModule* module)
         while (valsIter != values.End())
         {
             String name = (*valsIter).first_;
-            source_ += "   /** Deprecated - use: [[" + _enum->GetName() + "." + name + "]] */\n";
+            source_ += "   /** Deprecated - use: [[" + _enum->GetName() + "." + name + "]]\n@deprecated */\n";
             source_ += "   export var " + name + ": number;\n";
             valsIter++;
         }

+ 2 - 2
Source/ToolCore/JSBind/JavaScript/JSModuleWriter.cpp

@@ -234,7 +234,7 @@ void JSModuleWriter::WriteModulePreInit(String& source)
         while (itr != values.End())
         {
             String name = (*itr).first_;
-            source.AppendWithFormat("duk_push_number(ctx, (double) %s);\n", name.CString());
+            source.AppendWithFormat("duk_push_number(ctx, %s);\n", name.CString());
             source.AppendWithFormat("duk_put_prop_string(ctx, -2, \"%s\");\n",name.CString());
             itr++;
         }
@@ -247,7 +247,7 @@ void JSModuleWriter::WriteModulePreInit(String& source)
         while (itr != values.End())
         {
             String name = (*itr).first_;
-            source.AppendWithFormat("duk_push_number(ctx, (double) %s);\n", name.CString());
+            source.AppendWithFormat("duk_push_number(ctx, %s);\n", name.CString());
             source.AppendWithFormat("duk_put_prop_string(ctx, -2, \"%s\");\n",name.CString());
             itr++;
         }