Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
aac6432a
Commit
aac6432a
authored
13 years ago
by
Mark Miller
Browse files
Options
Downloads
Patches
Plain Diff
Updated converter to process the new IETCGlobalScope.js file.
parent
d403f61b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/converter/convert.js
+54
-2
54 additions, 2 deletions
tools/converter/convert.js
with
54 additions
and
2 deletions
tools/converter/convert.js
+
54
−
2
View file @
aac6432a
...
@@ -33,6 +33,31 @@
...
@@ -33,6 +33,31 @@
var
CONVERT_PATH
=
platform
.
CONVERTER_DIR
.
concat
(
'
convert.js
'
);
var
CONVERT_PATH
=
platform
.
CONVERTER_DIR
.
concat
(
'
convert.js
'
);
/**
* Extra in the sense that they are not redundant with the source,
* but add information that should be present in the converted
* source. So not test/suite/SputnikGlobalScope.js, since that is
* actually derived from sources.
*/
var
EXTRA_GLOBAL_SCOPE_TESTS
=
[
[
'
test
'
,
'
suite
'
,
'
IETCGlobalScope.js
'
]
];
/**
* Try prepending this to a relPath if necessary to get an index
* into EXTRA_GLOBAL_SCOPE_TESTS.
*/
var
EXTRANEOUS_PREFIXES
=
[
'
TestCases
'
];
/**
* Prepare for reading in the EXTRA_GLOBAL_SCOPE_TESTS, suppressing
* the "new Array()" that inappropriately still appears in
* IETCGlobalScope.js
*/
global
.
GlobalScopeTests
=
global
.
GlobalScopeTests
||
{};
global
.
EarlyErrorRePat
=
'
EarlyErrorRePat
'
;
global
.
NotEarlyErrorString
=
'
NotEarlyErrorString
'
;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
var
headerPattern
=
/
(?:(?:\/\/
.*
)?\s
*
\n)
*/
;
var
headerPattern
=
/
(?:(?:\/\/
.*
)?\s
*
\n)
*/
;
...
@@ -244,6 +269,8 @@
...
@@ -244,6 +269,8 @@
function
normalizeProps
(
testRecord
)
{
function
normalizeProps
(
testRecord
)
{
if
(
!
(
'
strict_only
'
in
testRecord
)
&&
testRecord
.
strict
===
1
)
{
if
(
!
(
'
strict_only
'
in
testRecord
)
&&
testRecord
.
strict
===
1
)
{
testRecord
.
strict_only
=
''
;
testRecord
.
strict_only
=
''
;
}
if
(
testRecord
.
strict
===
1
)
{
delete
testRecord
.
strict
;
delete
testRecord
.
strict
;
}
}
...
@@ -275,6 +302,21 @@
...
@@ -275,6 +302,21 @@
}
}
t262
.
normalizeProps
=
normalizeProps
;
t262
.
normalizeProps
=
normalizeProps
;
/**
* If relPath is represented in the EXTRA_GLOBAL_SCOPE_TESTS,
* retrieve the corresponding record. Otherwise, return undefined.
*/
function
getGlobalScopeRecord
(
relPath
)
{
var
key
=
toRelPathStr
(
relPath
);
var
val
=
global
.
GlobalScopeTests
[
key
];
if
(
!
val
)
{
key
=
toRelPathStr
(
EXTRANEOUS_PREFIXES
.
concat
(
relPath
));
val
=
global
.
GlobalScopeTests
[
key
];
}
return
val
;
}
t262
.
getGlobalScopeRecord
=
getGlobalScopeRecord
;
/**
/**
* Parses the source of a test262 test case file into a normalized
* Parses the source of a test262 test case file into a normalized
* JSON test record.
* JSON test record.
...
@@ -298,6 +340,16 @@
...
@@ -298,6 +340,16 @@
testRecord
.
test
=
envelope
.
rest
;
testRecord
.
test
=
envelope
.
rest
;
}
}
}
}
var
globalScopeRecord
=
getGlobalScopeRecord
(
nextRelPath
);
if
(
globalScopeRecord
)
{
forEach
(
keys
(
globalScopeRecord
),
function
(
key
)
{
if
(
!
(
key
in
testRecord
)
&&
key
!==
'
precondition
'
)
{
testRecord
[
key
]
=
globalScopeRecord
[
key
];
}
});
}
delete
testRecord
.
id
;
delete
testRecord
.
id
;
delete
testRecord
.
name
;
delete
testRecord
.
name
;
testRecord
.
path
=
toRelPathStr
(
nextRelPath
);
testRecord
.
path
=
toRelPathStr
(
nextRelPath
);
...
@@ -382,7 +434,7 @@
...
@@ -382,7 +434,7 @@
var
outFilePath
=
outPath
.
concat
([
name
]);
var
outFilePath
=
outPath
.
concat
([
name
]);
try
{
try
{
platform
.
writeSpawn
(
platform
.
writeSpawn
(
[
CONVERT_PATH
],
[
CONVERT_PATH
]
.
concat
(
EXTRA_GLOBAL_SCOPE_TESTS
)
,
'
t262.show(t262.convertTest("
'
+
toPathStr
(
inBase
)
+
'
t262.show(t262.convertTest("
'
+
toPathStr
(
inBase
)
+
'
", "
'
+
toRelPathStr
(
nextRelPath
)
+
'
"));
'
,
'
", "
'
+
toRelPathStr
(
nextRelPath
)
+
'
"));
'
,
void
0
,
void
0
,
...
@@ -473,7 +525,7 @@
...
@@ -473,7 +525,7 @@
var
outFilePath
=
outBase
.
concat
([
name
]);
var
outFilePath
=
outBase
.
concat
([
name
]);
try
{
try
{
platform
.
writeSpawn
(
platform
.
writeSpawn
(
[
CONVERT_PATH
],
[
CONVERT_PATH
]
.
concat
(
EXTRA_GLOBAL_SCOPE_TESTS
)
,
'
t262.showJSON(t262.buildSection("
'
+
toPathStr
(
inBase
)
+
'
t262.showJSON(t262.buildSection("
'
+
toPathStr
(
inBase
)
+
'
", "
'
+
toRelPathStr
(
nextRelPath
)
+
'
"));
'
,
'
", "
'
+
toRelPathStr
(
nextRelPath
)
+
'
"));
'
,
void
0
,
void
0
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment