mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 06:11:22 +00:00
[JSCRIPT] Sync with Wine Staging 4.18. CORE-16441
This commit is contained in:
parent
da0cd273de
commit
3e2d6582b7
31 changed files with 1860 additions and 1411 deletions
|
@ -16,8 +16,10 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
#ifdef __REACTOS__
|
||||
#include <wine/config.h>
|
||||
#include <wine/port.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
@ -294,6 +296,12 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
|
|||
*r = jsval_disp(V_DISPATCH(var));
|
||||
return S_OK;
|
||||
}
|
||||
case VT_I1:
|
||||
*r = jsval_number(V_I1(var));
|
||||
return S_OK;
|
||||
case VT_UI1:
|
||||
*r = jsval_number(V_UI1(var));
|
||||
return S_OK;
|
||||
case VT_I2:
|
||||
*r = jsval_number(V_I2(var));
|
||||
return S_OK;
|
||||
|
@ -516,7 +524,7 @@ static HRESULT str_to_number(jsstr_t *str, double *ret)
|
|||
if(!ptr)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
while(isspaceW(*ptr))
|
||||
while(iswspace(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(*ptr == '-') {
|
||||
|
@ -526,9 +534,9 @@ static HRESULT str_to_number(jsstr_t *str, double *ret)
|
|||
ptr++;
|
||||
}
|
||||
|
||||
if(!strncmpW(ptr, infinityW, ARRAY_SIZE(infinityW))) {
|
||||
if(!wcsncmp(ptr, infinityW, ARRAY_SIZE(infinityW))) {
|
||||
ptr += ARRAY_SIZE(infinityW);
|
||||
while(*ptr && isspaceW(*ptr))
|
||||
while(*ptr && iswspace(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(*ptr)
|
||||
|
@ -551,7 +559,7 @@ static HRESULT str_to_number(jsstr_t *str, double *ret)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
while(isdigitW(*ptr))
|
||||
while(iswdigit(*ptr))
|
||||
d = d*10 + (*ptr++ - '0');
|
||||
|
||||
if(*ptr == 'e' || *ptr == 'E') {
|
||||
|
@ -566,7 +574,7 @@ static HRESULT str_to_number(jsstr_t *str, double *ret)
|
|||
ptr++;
|
||||
}
|
||||
|
||||
while(isdigitW(*ptr))
|
||||
while(iswdigit(*ptr))
|
||||
l = l*10 + (*ptr++ - '0');
|
||||
if(eneg)
|
||||
l = -l;
|
||||
|
@ -576,13 +584,13 @@ static HRESULT str_to_number(jsstr_t *str, double *ret)
|
|||
DOUBLE dec = 0.1;
|
||||
|
||||
ptr++;
|
||||
while(isdigitW(*ptr)) {
|
||||
while(iswdigit(*ptr)) {
|
||||
d += dec * (*ptr++ - '0');
|
||||
dec *= 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
while(isspaceW(*ptr))
|
||||
while(iswspace(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(*ptr) {
|
||||
|
@ -894,6 +902,14 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
|
|||
}
|
||||
break;
|
||||
}
|
||||
case VT_UI2: {
|
||||
UINT32 i;
|
||||
|
||||
hres = to_uint32(ctx, val, &i);
|
||||
if(SUCCEEDED(hres))
|
||||
V_UI2(dst) = i;
|
||||
break;
|
||||
}
|
||||
case VT_R8: {
|
||||
double n;
|
||||
hres = to_number(ctx, val, &n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue