Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
28734e37
Commit
28734e37
authored
Aug 14, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Inherit some Error functions from Object.
parent
4791cdb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
43 deletions
+12
-43
error.c
dlls/jscript/error.c
+9
-41
global.c
dlls/jscript/global.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+1
-1
api.js
dlls/jscript/tests/api.js
+1
-0
No files found.
dlls/jscript/error.c
View file @
28734e37
...
...
@@ -38,10 +38,6 @@ static const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n'
static
const
WCHAR
messageW
[]
=
{
'm'
,
'e'
,
's'
,
's'
,
'a'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
numberW
[]
=
{
'n'
,
'u'
,
'm'
,
'b'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
hasOwnPropertyW
[]
=
{
'h'
,
'a'
,
's'
,
'O'
,
'w'
,
'n'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
0
};
static
const
WCHAR
propertyIsEnumerableW
[]
=
{
'p'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
'I'
,
's'
,
'E'
,
'n'
,
'u'
,
'm'
,
'e'
,
'r'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
isPrototypeOfW
[]
=
{
'i'
,
's'
,
'P'
,
'r'
,
'o'
,
't'
,
'o'
,
't'
,
'y'
,
'p'
,
'e'
,
'O'
,
'f'
,
0
};
static
HRESULT
Error_number
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
...
...
@@ -116,28 +112,6 @@ static HRESULT Error_toString(DispatchEx *dispex, LCID lcid, WORD flags,
return
S_OK
;
}
static
HRESULT
Error_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Error_propertyIsEnumerable
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Error_isPrototypeOf
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Error_value
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -166,11 +140,8 @@ static void Error_destructor(DispatchEx *dispex)
static
const
builtin_prop_t
Error_props
[]
=
{
{
descriptionW
,
Error_description
,
0
},
{
hasOwnPropertyW
,
Error_hasOwnProperty
,
PROPF_METHOD
},
{
isPrototypeOfW
,
Error_isPrototypeOf
,
PROPF_METHOD
},
{
messageW
,
Error_message
,
0
},
{
numberW
,
Error_number
,
0
},
{
propertyIsEnumerableW
,
Error_propertyIsEnumerable
,
PROPF_METHOD
},
{
toStringW
,
Error_toString
,
PROPF_METHOD
}
};
...
...
@@ -185,11 +156,8 @@ static const builtin_info_t Error_info = {
static
const
builtin_prop_t
ErrorInst_props
[]
=
{
{
descriptionW
,
Error_description
,
0
},
{
hasOwnPropertyW
,
Error_hasOwnProperty
,
PROPF_METHOD
},
{
isPrototypeOfW
,
Error_isPrototypeOf
,
PROPF_METHOD
},
{
messageW
,
Error_message
,
0
},
{
numberW
,
Error_number
,
0
},
{
propertyIsEnumerableW
,
Error_propertyIsEnumerable
,
PROPF_METHOD
}
};
static
const
builtin_info_t
ErrorInst_info
=
{
...
...
@@ -201,21 +169,21 @@ static const builtin_info_t ErrorInst_info = {
NULL
};
static
HRESULT
alloc_error
(
script_ctx_t
*
ctx
,
BOOL
error_
prototype
,
static
HRESULT
alloc_error
(
script_ctx_t
*
ctx
,
DispatchEx
*
prototype
,
DispatchEx
*
constr
,
ErrorInstance
**
ret
)
{
ErrorInstance
*
err
;
DispatchEx
*
inherit
;
HRESULT
hres
;
err
=
heap_alloc_zero
(
sizeof
(
ErrorInstance
));
if
(
!
err
)
return
E_OUTOFMEMORY
;
inherit
=
error_prototype
?
ctx
->
object_constr
:
ctx
->
error_constr
;
hres
=
init_dispex_from_constr
(
&
err
->
dispex
,
ctx
,
error_prototype
?
&
Error_info
:
&
ErrorInst_info
,
constr
?
constr
:
inherit
);
if
(
prototype
)
hres
=
init_dispex
(
&
err
->
dispex
,
ctx
,
&
Error_info
,
prototype
);
else
hres
=
init_dispex_from_constr
(
&
err
->
dispex
,
ctx
,
&
ErrorInst_info
,
constr
?
constr
:
ctx
->
error_constr
);
if
(
FAILED
(
hres
))
{
heap_free
(
err
);
return
hres
;
...
...
@@ -231,7 +199,7 @@ static HRESULT create_error(script_ctx_t *ctx, DispatchEx *constr,
ErrorInstance
*
err
;
HRESULT
hres
;
hres
=
alloc_error
(
ctx
,
FALSE
,
constr
,
&
err
);
hres
=
alloc_error
(
ctx
,
NULL
,
constr
,
&
err
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -366,7 +334,7 @@ static HRESULT URIErrorConstr_value(DispatchEx *dispex, LCID lcid, WORD flags,
dispex
->
ctx
->
uri_error_constr
);
}
HRESULT
init_error_constr
(
script_ctx_t
*
ctx
)
HRESULT
init_error_constr
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
)
{
static
const
WCHAR
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
ErrorW
[]
=
{
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
0
};
...
...
@@ -392,7 +360,7 @@ HRESULT init_error_constr(script_ctx_t *ctx)
HRESULT
hres
;
for
(
i
=
0
;
i
<
7
;
i
++
)
{
hres
=
alloc_error
(
ctx
,
i
==
0
,
NULL
,
&
err
);
hres
=
alloc_error
(
ctx
,
i
==
0
?
object_prototype
:
NULL
,
NULL
,
&
err
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/global.c
View file @
28734e37
...
...
@@ -766,7 +766,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype
if
(
FAILED
(
hres
))
return
hres
;
hres
=
init_error_constr
(
ctx
);
hres
=
init_error_constr
(
ctx
,
object_prototype
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
28734e37
...
...
@@ -229,7 +229,7 @@ HRESULT create_object_prototype(script_ctx_t*,DispatchEx**);
HRESULT
create_array_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_bool_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_date_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
init_error_constr
(
script_ctx_t
*
);
HRESULT
init_error_constr
(
script_ctx_t
*
,
DispatchEx
*
);
HRESULT
create_number_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_object_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_regexp_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
...
...
dlls/jscript/tests/api.js
View file @
28734e37
...
...
@@ -1392,5 +1392,6 @@ testObjectInherit(new Number(1), false, false, false);
testObjectInherit
(
new
Date
(),
false
,
false
,
false
);
testObjectInherit
(
new
Boolean
(
true
),
false
,
true
,
false
);
testObjectInherit
(
new
Array
(),
false
,
false
,
true
);
testObjectInherit
(
new
Error
(),
false
,
true
,
true
);
reportSuccess
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment