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
66ba778c
Commit
66ba778c
authored
Oct 02, 2014
by
Qian Hong
Committed by
Alexandre Julliard
Oct 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Ignore BOM mark in next_token.
parent
403ff373
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
lex.c
dlls/jscript/lex.c
+1
-1
run.c
dlls/jscript/tests/run.c
+53
-0
No files found.
dlls/jscript/lex.c
View file @
66ba778c
...
...
@@ -241,7 +241,7 @@ static BOOL skip_comment(parser_ctx_t *ctx)
static
BOOL
skip_spaces
(
parser_ctx_t
*
ctx
)
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
isspaceW
(
*
ctx
->
ptr
))
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
(
isspaceW
(
*
ctx
->
ptr
)
||
*
ctx
->
ptr
==
0xFEFF
/* UTF16 BOM */
))
{
if
(
is_endline
(
*
ctx
->
ptr
++
))
ctx
->
nl
=
TRUE
;
}
...
...
dlls/jscript/tests/run.c
View file @
66ba778c
...
...
@@ -144,6 +144,7 @@ DEFINE_EXPECT(DeleteMemberByDispID_false);
#define DISPID_TESTOBJ_ONLYDISPID 0x2001
#define DISPID_TESTOBJ_WITHPROP 0x2002
#define JS_E_OUT_OF_MEMORY 0x800a03ec
#define JS_E_INVALID_CHAR 0x800a03f6
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -1966,6 +1967,56 @@ static void test_script_exprs(void)
testing_expr
=
FALSE
;
}
struct
bom_test
{
WCHAR
str
[
1024
];
HRESULT
hres
;
};
static
void
run_bom_tests
(
void
)
{
BSTR
src
;
int
i
;
HRESULT
hres
;
struct
bom_test
bom_tests
[]
=
{
{{
'v'
,
'a'
,
'r'
,
' '
,
'a'
,
' '
,
'='
,
' '
,
'1'
,
';'
,
' '
,
'r'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'S'
,
'u'
,
'c'
,
'c'
,
'e'
,
's'
,
's'
,
'('
,
')'
,
';'
,
'\0'
},
S_OK
},
{{
0xFEFF
,
'v'
,
'a'
,
'r'
,
' '
,
'a'
,
' '
,
'='
,
' '
,
'1'
,
';'
,
' '
,
'r'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'S'
,
'u'
,
'c'
,
'c'
,
'e'
,
's'
,
's'
,
'('
,
')'
,
';'
,
'\0'
},
S_OK
},
{{
'v'
,
0xFEFF
,
'a'
,
'r'
,
' '
,
'a'
,
' '
,
'='
,
' '
,
'1'
,
';'
,
' '
,
'r'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'S'
,
'u'
,
'c'
,
'c'
,
'e'
,
's'
,
's'
,
'('
,
')'
,
';'
,
'\0'
},
JS_E_OUT_OF_MEMORY
},
{{
'v'
,
'a'
,
'r'
,
0xFEFF
,
' '
,
'a'
,
' '
,
'='
,
' '
,
'1'
,
';'
,
' '
,
'r'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'S'
,
'u'
,
'c'
,
'c'
,
'e'
,
's'
,
's'
,
'('
,
')'
,
';'
,
'\0'
},
S_OK
},
{{
'v'
,
'a'
,
'r'
,
' '
,
'a'
,
' '
,
'='
,
' '
,
'1'
,
';'
,
' '
,
0xFEFF
,
'r'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'S'
,
'u'
,
'c'
,
'c'
,
'e'
,
's'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[
0
];
i
++
)
{
if
(
bom_tests
[
i
].
hres
==
S_OK
)
{
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
src
=
SysAllocString
(
bom_tests
[
i
].
str
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
ok
(
hres
==
S_OK
,
"test %s failed with %08x
\n
"
,
wine_dbgstr_w
(
src
),
hres
);
SysFreeString
(
src
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
}
else
{
src
=
SysAllocString
(
bom_tests
[
i
].
str
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
todo_wine
ok
(
hres
==
bom_tests
[
i
].
hres
,
"test %s returned with %08x
\n
"
,
wine_dbgstr_w
(
src
),
hres
);
SysFreeString
(
src
);
}
}
}
static
BOOL
run_tests
(
void
)
{
HRESULT
hres
;
...
...
@@ -2259,6 +2310,8 @@ static BOOL run_tests(void)
"Object expected"
,
NULL
);
run_bom_tests
();
return
TRUE
;
}
...
...
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