[JSCRIPT]
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 23 Apr 2014 13:43:40 +0000 (13:43 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 23 Apr 2014 13:43:40 +0000 (13:43 +0000)
* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62899

13 files changed:
reactos/dll/win32/jscript/CMakeLists.txt
reactos/dll/win32/jscript/global.c
reactos/dll/win32/jscript/jscript.rc
reactos/dll/win32/jscript/jscript_classes.idl
reactos/dll/win32/jscript/jscript_classes.rgs
reactos/dll/win32/jscript/jsglobal.idl
reactos/dll/win32/jscript/jsglobal.rgs [new file with mode: 0644]
reactos/dll/win32/jscript/jsutils.c
reactos/dll/win32/jscript/lex.c
reactos/dll/win32/jscript/parser.y
reactos/dll/win32/jscript/regexp.c
reactos/dll/win32/jscript/string.c
reactos/media/doc/README.WINE

index f49a2ec..6cb5c1d 100644 (file)
@@ -36,6 +36,7 @@ list(APPEND SOURCE
 list(APPEND jscript_rc_deps
     ${CMAKE_CURRENT_SOURCE_DIR}/jscript.rgs
     ${CMAKE_CURRENT_SOURCE_DIR}/jscript_classes.rgs
+    ${CMAKE_CURRENT_SOURCE_DIR}/jsglobal.rgs
     ${CMAKE_CURRENT_BINARY_DIR}/jsglobal.tlb)
 
 set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS "${jscript_rc_deps}")
index fa1b791..bde5f0f 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "jscript.h"
 
-#define LONGLONG_MAX (((LONGLONG)0x7fffffff<<32)|0xffffffff)
 
 static const WCHAR NaNW[] = {'N','a','N',0};
 static const WCHAR InfinityW[] = {'I','n','f','i','n','i','t','y',0};
@@ -543,7 +542,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
 
     while(isdigitW(*str)) {
         hlp = d*10 + *(str++) - '0';
-        if(d>LONGLONG_MAX/10 || hlp<0) {
+        if(d>MAXLONGLONG/10 || hlp<0) {
             exp++;
             break;
         }
@@ -562,7 +561,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
 
     while(isdigitW(*str)) {
         hlp = d*10 + *(str++) - '0';
-        if(d>LONGLONG_MAX/10 || hlp<0)
+        if(d>MAXLONGLONG/10 || hlp<0)
             break;
 
         d = hlp;
index ec8e60c..3317c4b 100644 (file)
@@ -66,7 +66,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 /* @makedep: jscript.rgs */
 2 WINE_REGISTRY jscript.rgs
 
-3 WINE_REGISTRY "jscript_classes.rgs"
+3 WINE_REGISTRY jscript_classes.rgs
+4 WINE_REGISTRY jsglobal.rgs
 
 #define WINE_FILEDESCRIPTION_STR "Wine JScript"
 #define WINE_FILENAME_STR "jscript.dll"
index d9f481e..597d69e 100644 (file)
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#pragma makedep register
+
 [
     helpstring("JScript Language"),
     threading(both),
index 4a28efc..ae671fc 100644 (file)
@@ -33,147 +33,4 @@ HKCR
     {
         CLSID = s '{F414C262-6AC0-11CF-B6D1-00AA00BBBB58}'
     }
-    NoRemove Typelib
-    {
-        NoRemove '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}'
-        {
-            '1.0' = s 'JSGlobal'
-            {
-                '0' { win32 = s '%MODULE%' }
-                FLAGS = s '0'
-            }
-        }
-    }
-    NoRemove Interface
-    {
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B086}' = s 'GlobalObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B087}' = s 'DateObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B088}' = s 'MathObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B089}' = s 'NumberObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B090}' = s 'RegExpObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B091}' = s 'StringObj'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B092}' = s 'ArrayInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B093}' = s 'FunctionInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B094}' = s 'StringInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B095}' = s 'BoolInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B096}' = s 'NumberInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B097}' = s 'ObjectInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B098}' = s 'DateInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B099}' = s 'RegExpInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09A}' = s 'ErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09B}' = s 'EvalErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09C}' = s 'RangeErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09D}' = s 'ReferenceErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09E}' = s 'SyntaxErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09F}' = s 'TypeErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B0A0}' = s 'URIErrorInstance'
-        {
-            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
-            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
-            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
-        }
-    }
-    NoRemove CLSID
-    {
-    }
 }
index bd91a60..b8604e9 100644 (file)
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#pragma makedep regtypelib
+
 #include "jsglobal_dispid.h"
 
 import "oaidl.idl";
diff --git a/reactos/dll/win32/jscript/jsglobal.rgs b/reactos/dll/win32/jscript/jsglobal.rgs
new file mode 100644 (file)
index 0000000..42c1a80
--- /dev/null
@@ -0,0 +1,146 @@
+HKCR
+{
+    NoRemove Typelib
+    {
+        NoRemove '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}'
+        {
+            '1.0' = s 'JSGlobal'
+            {
+                '0' { win32 = s '%MODULE%' }
+                FLAGS = s '0'
+            }
+        }
+    }
+    NoRemove Interface
+    {
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B086}' = s 'GlobalObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B087}' = s 'DateObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B088}' = s 'MathObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B089}' = s 'NumberObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B090}' = s 'RegExpObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B091}' = s 'StringObj'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B092}' = s 'ArrayInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B093}' = s 'FunctionInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B094}' = s 'StringInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B095}' = s 'BoolInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B096}' = s 'NumberInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B097}' = s 'ObjectInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B098}' = s 'DateInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B099}' = s 'RegExpInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09A}' = s 'ErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09B}' = s 'EvalErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09C}' = s 'RangeErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09D}' = s 'ReferenceErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09E}' = s 'SyntaxErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B09F}' = s 'TypeErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+        '{3EEF9758-35FC-11D1-8CE4-00C04FC2B0A0}' = s 'URIErrorInstance'
+        {
+            ProxyStubClsid = s '{00020424-0000-0000-C000-000000000046}'
+            ProxyStubClsid32 = s '{00020424-0000-0000-C000-000000000046}'
+            TypeLib = s '{3EEF9759-35FC-11D1-8CE4-00C04FC2B085}' { val Version = s '1.0' }
+        }
+    }
+    NoRemove CLSID
+    {
+    }
+}
index 7383370..bf94580 100644 (file)
@@ -317,6 +317,9 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
                 *r = jsval_disp(disp);
                 return S_OK;
             }
+        }else {
+            *r = jsval_disp(NULL);
+            return S_OK;
         }
         /* fall through */
     default:
index effdf64..3d55845 100644 (file)
@@ -384,7 +384,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
     d = int_part;
     while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) {
         hlp = d*10 + *(ctx->ptr++) - '0';
-        if(d>LONGLONG_MAX/10 || hlp<0) {
+        if(d>MAXLONGLONG/10 || hlp<0) {
             exp++;
             break;
         }
@@ -401,7 +401,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
 
         while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) {
             hlp = d*10 + *(ctx->ptr++) - '0';
-            if(d>LONGLONG_MAX/10 || hlp<0)
+            if(d>MAXLONGLONG/10 || hlp<0)
                 break;
 
             d = hlp;
@@ -443,6 +443,11 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
         else exp += e;
     }
 
+    if(is_identifier_char(*ctx->ptr)) {
+        WARN("wrong char after zero\n");
+        return lex_error(ctx, JS_E_MISSING_SEMICOLON);
+    }
+
     *literal = new_double_literal(ctx, exp>=0 ? d*pow(10, exp) : d/pow(10, -exp));
     return tNumericLiteral;
 }
@@ -466,21 +471,42 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
 
             if(ctx->ptr < ctx->end && is_identifier_char(*ctx->ptr)) {
                 WARN("unexpected identifier char\n");
-                return lex_error(ctx, E_FAIL);
+                return lex_error(ctx, JS_E_MISSING_SEMICOLON);
             }
 
             *literal = new_double_literal(ctx, l);
             return tNumericLiteral;
         }
 
-        if(is_identifier_char(*ctx->ptr)) {
-            WARN("wrong char after zero\n");
-            return lex_error(ctx, E_FAIL);
+        if(isdigitW(*ctx->ptr)) {
+            unsigned base = 8;
+            const WCHAR *ptr;
+            double val = 0;
+
+            for(ptr = ctx->ptr; ptr < ctx->end && isdigitW(*ptr); ptr++) {
+                if(*ptr > '7') {
+                    base = 10;
+                    break;
+                }
+            }
+
+            do {
+                val = val*base + *ctx->ptr-'0';
+            }while(++ctx->ptr < ctx->end && isdigitW(*ctx->ptr));
+
+            /* FIXME: Do we need it here? */
+            if(ctx->ptr < ctx->end && (is_identifier_char(*ctx->ptr) || *ctx->ptr == '.')) {
+                WARN("wrong char after octal literal: '%c'\n", *ctx->ptr);
+                return lex_error(ctx, JS_E_MISSING_SEMICOLON);
+            }
+
+            *literal = new_double_literal(ctx, val);
+            return tNumericLiteral;
         }
 
-        if(isdigitW(*ctx->ptr)) {
-            FIXME("octal literals not implemented\n");
-            return lex_error(ctx, E_NOTIMPL);
+        if(is_identifier_char(*ctx->ptr)) {
+            WARN("wrong char after zero\n");
+            return lex_error(ctx, JS_E_MISSING_SEMICOLON);
         }
     }
 
index b1ce3a6..327366a 100644 (file)
@@ -1385,7 +1385,7 @@ static expression_t *new_call_expression(parser_ctx_t *ctx, expression_t *expres
     return &ret->expr;
 }
 
-static int parser_error(const char *str)
+static int parser_error(parser_ctx_t *ctx, const char *str)
 {
     return 0;
 }
index ed38448..6152ea0 100644 (file)
@@ -883,7 +883,7 @@ ProcessOp(CompilerState *state, REOpData *opData, RENode **operandStack,
 
 /*
  * Hack two bits in CompilerState.flags, for use within FindParenCount to flag
- * its being on the stack, and to propagate errors to its callers.
+ * it being on the stack, and to propagate errors to its callers.
  */
 #define JSREG_FIND_PAREN_COUNT  0x8000
 #define JSREG_FIND_PAREN_ERROR  0x4000
index 08ef69f..e2df888 100644 (file)
@@ -1637,26 +1637,21 @@ static HRESULT StringConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
         break;
     }
     case DISPATCH_CONSTRUCT: {
+        jsstr_t *str;
         jsdisp_t *ret;
 
         if(argc) {
-            jsstr_t *str;
-
             hres = to_string(ctx, argv[0], &str);
             if(FAILED(hres))
                 return hres;
-
-            hres = create_string(ctx, str, &ret);
-            jsstr_release(str);
         }else {
-            hres = create_string(ctx, jsstr_empty(), &ret);
+            str = jsstr_empty();
         }
 
-        if(FAILED(hres))
-            return hres;
-
-        *r = jsval_obj(ret);
-        break;
+        hres = create_string(ctx, str, &ret);
+        if (SUCCEEDED(hres)) *r = jsval_obj(ret);
+        jsstr_release(str);
+        return hres;
     }
 
     default:
index c8b6ca7..0626703 100644 (file)
@@ -92,7 +92,7 @@ reactos/dll/win32/inseng           # Synced to Wine-1.7.1
 reactos/dll/win32/iphlpapi         # Out of sync
 reactos/dll/win32/itircl           # Synced to Wine-1.7.1
 reactos/dll/win32/itss             # Synced to Wine-1.7.17
-reactos/dll/win32/jscript          # Synced to Wine-1.7.1
+reactos/dll/win32/jscript          # Synced to Wine-1.7.17
 reactos/dll/win32/loadperf         # Synced to Wine-1.7.1
 reactos/dll/win32/localspl         # Synced to Wine-1.7.1
 reactos/dll/win32/localui          # Synced to Wine-1.7.1