Skip to content

Commit 1f6e17c

Browse files
ShortDevelopmentrhuanjl
authored andcommitted
Fix formatting
1 parent 1a03ab0 commit 1f6e17c

File tree

2 files changed

+33
-44
lines changed

2 files changed

+33
-44
lines changed

test/Array/array_splice_double.js

+30-38
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ WScript.Echo(a);
4444
WScript.Echo(x);
4545

4646
//Test array
47-
var b = [8.32,9.232];
48-
var c = [11.232,12.234];
47+
var b = [8.32, 9.232];
48+
var c = [11.232, 12.234];
4949

50-
x = a.splice(5,1);
50+
x = a.splice(5, 1);
5151
WScript.Echo(x);
5252
WScript.Echo(a);
5353

@@ -73,7 +73,7 @@ f.x = 0;
7373
f.y = 1;
7474
f.z = 2;
7575

76-
x = a.splice(1,2, f, "hello");
76+
x = a.splice(1, 2, f, "hello");
7777
WScript.Echo(x);
7878
WScript.Echo(a);
7979

@@ -116,37 +116,31 @@ WScript.Echo(x.length);
116116
x = new String("hello world");
117117
x.foo = Array.prototype.splice;
118118
y = undefined;
119-
try
120-
{
121-
y = x.foo(0, 5);
119+
try {
120+
y = x.foo(0, 5);
122121
}
123-
catch(e)
124-
{
125-
if (!(e instanceof TypeError)) throw(e);
126-
WScript.Echo(y);
127-
WScript.Echo(x);
122+
catch (e) {
123+
if (!(e instanceof TypeError)) throw (e);
124+
WScript.Echo(y);
125+
WScript.Echo(x);
128126
}
129127

130-
try
131-
{
132-
y = x.foo(0, 5);
128+
try {
129+
y = x.foo(0, 5);
133130
}
134-
catch(e)
135-
{
136-
if (!(e instanceof TypeError)) throw(e);
137-
WScript.Echo(y);
138-
WScript.Echo(x);
131+
catch (e) {
132+
if (!(e instanceof TypeError)) throw (e);
133+
WScript.Echo(y);
134+
WScript.Echo(x);
139135
}
140136

141-
try
142-
{
143-
y = x.foo(0, 13);
137+
try {
138+
y = x.foo(0, 13);
144139
}
145-
catch(e)
146-
{
147-
if (!(e instanceof TypeError)) throw(e);
148-
WScript.Echo(y);
149-
WScript.Echo(x);
140+
catch (e) {
141+
if (!(e instanceof TypeError)) throw (e);
142+
WScript.Echo(y);
143+
WScript.Echo(x);
150144
}
151145

152146
WScript.Echo("Test: splice when the item to replace is not writable."); // WOOB: 1139812
@@ -155,23 +149,21 @@ Object.defineProperty(a, "0", { value: 0 });
155149
Object.defineProperty(a, "1", { value: 1 });
156150
a.length = 2;
157151
try {
158-
Array.prototype.splice.apply(a, [0, 1, 'z']);
152+
Array.prototype.splice.apply(a, [0, 1, 'z']);
159153
} catch (ex) {
160-
WScript.Echo("e instanceOf TypeError = " + (ex instanceof TypeError));
154+
WScript.Echo("e instanceOf TypeError = " + (ex instanceof TypeError));
161155
}
162156
WScript.Echo("a.length = " + a.length);
163157

164158
a = new Array(1000);
165159
x = a.splice(1, 17, "a");
166160

167-
function test0()
168-
{
169-
var arr = [0,1.12,2.23,3,4.32,5,6.23,7,8,9];
170-
for(var __loopvar4 = 0; __loopvar4 < 2; __loopvar4++)
171-
{
172-
arr.length --;
173-
arr.splice(3,1,31.23,32.32,33.23);
161+
function test0() {
162+
var arr = [0, 1.12, 2.23, 3, 4.32, 5, 6.23, 7, 8, 9];
163+
for (var __loopvar4 = 0; __loopvar4 < 2; __loopvar4++) {
164+
arr.length--;
165+
arr.splice(3, 1, 31.23, 32.32, 33.23);
174166
}
175167
return arr.length;
176168
}
177-
WScript.Echo("arr.length = " + test0());
169+
WScript.Echo("arr.length = " + test0());

test/es5/RegExpStrictDelete.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
var props = Object.getOwnPropertyNames(RegExp);
1010
props.sort();
1111

12-
for (var i = 0, len = props.length; i < len; i++)
13-
{
12+
for (var i = 0, len = props.length; i < len; i++) {
1413
var prop = props[i];
1514
if (prop === 'prototype')
1615
continue;
17-
try
18-
{
16+
try {
1917
WScript.Echo("Testing: delete RegExp[" + prop + "]");
2018
var result = delete RegExp[prop];
2119
if (result === false)
2220
WScript.Echo("Error: strict delete returned false");
2321
}
24-
catch (err)
25-
{
22+
catch (err) {
2623
if (!(err instanceof TypeError))
2724
WScript.Echo("Error: strict delete threw a non-TypeError: " + err);
2825
}

0 commit comments

Comments
 (0)