forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsamethread.js
More file actions
37 lines (33 loc) · 1.35 KB
/
samethread.js
File metadata and controls
37 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var fileNames = ["dataview.js", "int8array.js", "uint8array.js", "int16array.js", "uint16array.js",
"int32array.js", "uint32array.js", "float32array.js", "float64array.js"];
for (var i = 0; i < fileNames.length; i++) {
WScript.Echo("testing file " + fileNames[i]);
oneFile(fileNames[i]);
}
function oneFile(fileName) {
var frame = WScript.LoadScriptFile(fileName, "samethread");
WScript.Echo("Start same thread different engine test on file " + fileName);
for (var i in frame) {
if (i == 'WScript' || i == 'SCA' || i == 'ImageData' || i == 'console') {
continue;
}
WScript.Echo("property of global: " + i);
if (typeof frame[i] == "object") {
for (var j in frame[i]) {
WScript.Echo("sub object " + j + " in " + i + " is " + frame[i][j]);
}
}
try {
if (typeof frame[i] == "function") {
frame[i]();
}
}
catch (e) {
WScript.Echo("exception is " + e.number + e.description);
}
}
}