Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5d412056
Commit
5d412056
authored
Aug 12, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Inherit some RegExp functions from Object.
parent
79f45c53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
48 deletions
+12
-48
global.c
dlls/jscript/global.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+1
-1
regexp.c
dlls/jscript/regexp.c
+7
-44
api.js
dlls/jscript/tests/api.js
+3
-2
No files found.
dlls/jscript/global.c
View file @
5d412056
...
...
@@ -774,7 +774,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype
if
(
FAILED
(
hres
))
return
hres
;
hres
=
create_regexp_constr
(
ctx
,
&
ctx
->
regexp_constr
);
hres
=
create_regexp_constr
(
ctx
,
object_prototype
,
&
ctx
->
regexp_constr
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
5d412056
...
...
@@ -231,7 +231,7 @@ HRESULT create_date_constr(script_ctx_t*,DispatchEx**);
HRESULT
init_error_constr
(
script_ctx_t
*
);
HRESULT
create_number_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_object_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_regexp_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_regexp_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
*
*
);
HRESULT
create_string_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
typedef
struct
{
...
...
dlls/jscript/regexp.c
View file @
5d412056
...
...
@@ -90,11 +90,6 @@ static const WCHAR ignoreCaseW[] = {'i','g','n','o','r','e','C','a','s','e',0};
static
const
WCHAR
multilineW
[]
=
{
'm'
,
'u'
,
'l'
,
't'
,
'i'
,
'l'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
lastIndexW
[]
=
{
'l'
,
'a'
,
's'
,
't'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
toLocaleStringW
[]
=
{
't'
,
'o'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'e'
,
'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
const
WCHAR
execW
[]
=
{
'e'
,
'x'
,
'e'
,
'c'
,
0
};
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -3471,34 +3466,6 @@ static HRESULT RegExp_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
return
E_NOTIMPL
;
}
static
HRESULT
RegExp_toLocaleString
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
RegExp_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
RegExp_propertyIsEnumerable
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
RegExp_isPrototypeOf
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
RegExp_exec
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -3542,15 +3509,11 @@ static void RegExp_destructor(DispatchEx *dispex)
static
const
builtin_prop_t
RegExp_props
[]
=
{
{
execW
,
RegExp_exec
,
PROPF_METHOD
},
{
globalW
,
RegExp_global
,
0
},
{
hasOwnPropertyW
,
RegExp_hasOwnProperty
,
PROPF_METHOD
},
{
ignoreCaseW
,
RegExp_ignoreCase
,
0
},
{
isPrototypeOfW
,
RegExp_isPrototypeOf
,
PROPF_METHOD
},
{
lastIndexW
,
RegExp_lastIndex
,
0
},
{
multilineW
,
RegExp_multiline
,
0
},
{
propertyIsEnumerableW
,
RegExp_propertyIsEnumerable
,
PROPF_METHOD
},
{
sourceW
,
RegExp_source
,
0
},
{
testW
,
RegExp_test
,
PROPF_METHOD
},
{
toLocaleStringW
,
RegExp_toLocaleString
,
PROPF_METHOD
},
{
toStringW
,
RegExp_toString
,
PROPF_METHOD
}
};
...
...
@@ -3563,7 +3526,7 @@ static const builtin_info_t RegExp_info = {
NULL
};
static
HRESULT
alloc_regexp
(
script_ctx_t
*
ctx
,
BOOL
use_constr
,
RegExpInstance
**
ret
)
static
HRESULT
alloc_regexp
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
RegExpInstance
**
ret
)
{
RegExpInstance
*
regexp
;
HRESULT
hres
;
...
...
@@ -3572,10 +3535,10 @@ static HRESULT alloc_regexp(script_ctx_t *ctx, BOOL use_constr, RegExpInstance *
if
(
!
regexp
)
return
E_OUTOFMEMORY
;
if
(
use_constr
)
hres
=
init_dispex
_from_constr
(
&
regexp
->
dispex
,
ctx
,
&
RegExp_info
,
ctx
->
regexp_constr
);
if
(
object_prototype
)
hres
=
init_dispex
(
&
regexp
->
dispex
,
ctx
,
&
RegExp_info
,
object_prototype
);
else
hres
=
init_dispex
(
&
regexp
->
dispex
,
ctx
,
&
RegExp_info
,
NULL
);
hres
=
init_dispex
_from_constr
(
&
regexp
->
dispex
,
ctx
,
&
RegExp_info
,
ctx
->
regexp_constr
);
if
(
FAILED
(
hres
))
{
heap_free
(
regexp
);
...
...
@@ -3593,7 +3556,7 @@ static HRESULT create_regexp(script_ctx_t *ctx, const WCHAR *exp, int len, DWORD
TRACE
(
"%s %x
\n
"
,
debugstr_w
(
exp
),
flags
);
hres
=
alloc_regexp
(
ctx
,
TRUE
,
&
regexp
);
hres
=
alloc_regexp
(
ctx
,
NULL
,
&
regexp
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -3694,12 +3657,12 @@ static HRESULT RegExpConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS
return
S_OK
;
}
HRESULT
create_regexp_constr
(
script_ctx_t
*
ctx
,
DispatchEx
**
ret
)
HRESULT
create_regexp_constr
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
DispatchEx
*
*
ret
)
{
RegExpInstance
*
regexp
;
HRESULT
hres
;
hres
=
alloc_regexp
(
ctx
,
FALSE
,
&
regexp
);
hres
=
alloc_regexp
(
ctx
,
object_prototype
,
&
regexp
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
5d412056
...
...
@@ -1374,10 +1374,11 @@ function testObjectInherit(obj, ts, tls, vo) {
ok
(
obj
.
valueOf
!=
Object
.
prototype
.
valueOf
,
"obj.valueOf == Object.prototype.valueOf"
);
ok
(
obj
.
test
===
"test"
,
"obj.test = "
+
obj
.
test
);
ok
(
obj
.
_test
===
"test"
,
"obj.test = "
+
obj
.
_
test
);
}
Object
.
prototype
.
test
=
"test"
;
Object
.
prototype
.
_
test
=
"test"
;
testObjectInherit
(
new
String
(
"test"
),
false
,
true
,
false
);
testObjectInherit
(
/test/g
,
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