mirror of
https://github.com/google/pebble.git
synced 2025-06-26 02:46:16 +00:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
47
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-001.js
vendored
Normal file
47
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-001.js
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {p1: 1,
|
||||
p2: {p1: 100, p2: 200, p3: 100},
|
||||
p3: 4,
|
||||
p4: 7,
|
||||
p5: 124686,
|
||||
p6: {p1: 100, p2: 200, p3: 100},
|
||||
p7: 1},
|
||||
sum = 0;
|
||||
|
||||
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "p4")
|
||||
break;
|
||||
|
||||
if (typeof (o[p]) === "object")
|
||||
{
|
||||
top:
|
||||
for (var pp in o[p])
|
||||
{
|
||||
if (pp === "p2")
|
||||
break top;
|
||||
|
||||
sum += o[p][pp];
|
||||
}
|
||||
}
|
||||
|
||||
sum += 20;
|
||||
|
||||
}
|
||||
|
||||
assert(sum === 160);
|
||||
|
45
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-002.js
vendored
Normal file
45
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-002.js
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {p1: 1,
|
||||
p2: {p1: 100, p2: 200, p3: 100},
|
||||
p3: 4,
|
||||
p4: 7,
|
||||
p5: 124686,
|
||||
p6: {p1: 100, p2: 200, p3: 100},
|
||||
p7: 1},
|
||||
sum = 0;
|
||||
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "p4")
|
||||
break;
|
||||
|
||||
if (typeof (o[p]) === "object")
|
||||
{
|
||||
for (var pp in o[p])
|
||||
{
|
||||
if (pp === "p2")
|
||||
break;
|
||||
|
||||
sum += o[p][pp];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sum += 20;
|
||||
}
|
||||
}
|
||||
|
||||
assert(sum === 140);
|
26
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-003.js
vendored
Normal file
26
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-003.js
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0;
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
if (i === 5)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
sum += i;
|
||||
}
|
||||
|
||||
assert(sum === 10);
|
30
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-004.js
vendored
Normal file
30
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-004.js
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function main()
|
||||
{
|
||||
var sum = 0;
|
||||
for (var i = 0; i < 10; i++)
|
||||
for (var j = 0; j < 20; j++)
|
||||
{
|
||||
if (j === 10)
|
||||
break;
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
|
||||
assert(sum === 100);
|
||||
}
|
||||
|
||||
main ();
|
28
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-005.js
vendored
Normal file
28
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-005.js
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0;
|
||||
|
||||
ForLabel:
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
if (i === 5)
|
||||
{
|
||||
break ForLabel;
|
||||
}
|
||||
|
||||
sum += i;
|
||||
}
|
||||
|
||||
assert(sum === 10);
|
30
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-006.js
vendored
Normal file
30
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-006.js
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0;
|
||||
top:
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
for (var j = 0; j < 20; j++)
|
||||
{
|
||||
if (j > 9 && i % 2)
|
||||
break top;
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
|
||||
assert(sum === 31);
|
27
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-007.js
vendored
Normal file
27
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-007.js
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var mask = 0xff0f;
|
||||
var numOnes = 0;
|
||||
|
||||
while (mask)
|
||||
{
|
||||
if (!(mask & 1))
|
||||
break;
|
||||
|
||||
mask >>= 1;
|
||||
numOnes++;
|
||||
}
|
||||
|
||||
assert(numOnes === 4);
|
33
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-008.js
vendored
Normal file
33
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-008.js
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var i = 9;
|
||||
var cnt = 0;
|
||||
|
||||
while (i-- > 0)
|
||||
{
|
||||
if (i % 2)
|
||||
break;
|
||||
|
||||
var j = 0;
|
||||
while (j++ < 20)
|
||||
{
|
||||
if (j % 2 === 0)
|
||||
break;
|
||||
cnt++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
assert(cnt === 1);
|
29
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-009.js
vendored
Normal file
29
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-009.js
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
var sum = 0, i = 0;
|
||||
|
||||
WhileLabel:
|
||||
while (++i < 10)
|
||||
{
|
||||
if (i === 5)
|
||||
{
|
||||
break WhileLabel;
|
||||
}
|
||||
|
||||
sum += i;
|
||||
}
|
||||
|
||||
assert(sum === 10);
|
32
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-010.js
vendored
Normal file
32
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-010.js
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0;
|
||||
var i = 0, j = 0;
|
||||
top:
|
||||
while (i++ < 10)
|
||||
{
|
||||
j = 0;
|
||||
while (j++ < 20)
|
||||
{
|
||||
if (j > 9 && i % 2)
|
||||
break top;
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
|
||||
assert(sum === 9);
|
27
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-011.js
vendored
Normal file
27
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-011.js
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var mask = 0xff0f;
|
||||
var numOnes = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if (!(mask & 1))
|
||||
break;
|
||||
|
||||
mask >>= 1;
|
||||
numOnes++;
|
||||
} while (mask);
|
||||
|
||||
assert(numOnes === 4);
|
34
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-012.js
vendored
Normal file
34
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-012.js
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var i = 10;
|
||||
var cnt = 0;
|
||||
|
||||
do
|
||||
{
|
||||
var j = 0;
|
||||
do
|
||||
{
|
||||
if (j % 2 === 0)
|
||||
break;
|
||||
cnt++;
|
||||
}
|
||||
while (j++ < 20)
|
||||
|
||||
if (i % 2)
|
||||
break;
|
||||
}
|
||||
while (i-- > 0);
|
||||
|
||||
assert(cnt === 0);
|
29
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-013.js
vendored
Normal file
29
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-013.js
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0, i = 0;
|
||||
|
||||
DoWhileLabel:
|
||||
do
|
||||
{
|
||||
if (i === 5)
|
||||
{
|
||||
break DoWhileLabel;
|
||||
}
|
||||
|
||||
sum += i;
|
||||
}
|
||||
while (++i < 10);
|
||||
|
||||
assert(sum === 10);
|
35
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-014.js
vendored
Normal file
35
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-014.js
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var sum = 0;
|
||||
var i = 0, j = 0;
|
||||
top:
|
||||
do
|
||||
{
|
||||
j = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if (j > 9 && i % 2)
|
||||
break top;
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
while (j++ < 20);
|
||||
|
||||
sum += 1;
|
||||
}
|
||||
while (i++ < 10);
|
||||
|
||||
assert(sum === 32);
|
26
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-015.js
vendored
Normal file
26
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-015.js
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {p1: 1, p2: 2, p3: 3, p4: 1, p5: 2}, sum = 0;
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "p3")
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
sum += o[p];
|
||||
}
|
||||
|
||||
assert(sum === 3);
|
36
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-016.js
vendored
Normal file
36
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-016.js
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {p1: 1, p2: 2, p3: {p1: 150, p2: 200, p3: 130, p4: 20}, p4: 4, p5: 46}, sum = 0;
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "p4")
|
||||
continue;
|
||||
|
||||
if (typeof (o[p]) === "object")
|
||||
{
|
||||
for (var pp in o[p])
|
||||
{
|
||||
if (pp === "p2")
|
||||
break;
|
||||
|
||||
sum += o[p][pp];
|
||||
}
|
||||
}
|
||||
else {
|
||||
sum += o[p];
|
||||
}
|
||||
}
|
||||
|
||||
assert(sum === 199);
|
25
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-017.js
vendored
Normal file
25
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-017.js
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {a: 1, b: 2, c: 3};
|
||||
|
||||
ForLabel:
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "b")
|
||||
break ForLabel;
|
||||
o[p] += 4;
|
||||
}
|
||||
|
||||
assert(o.a + o.b + o.c === 10);
|
45
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-018.js
vendored
Normal file
45
third_party/jerryscript/tests/jerry-test-suite/12/12.08/12.08-018.js
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var o = {p1: 1,
|
||||
p2: {p1: 100, p2: 200, p3: 100},
|
||||
p3: 4,
|
||||
p4: 7,
|
||||
p5: 124686,
|
||||
p6: {p1: 100, p2: 200, p3: 100},
|
||||
p7: 1},
|
||||
sum = 0;
|
||||
|
||||
top:
|
||||
for (var p in o)
|
||||
{
|
||||
if (p === "p4")
|
||||
break;
|
||||
|
||||
if (typeof (o[p]) === "object")
|
||||
{
|
||||
for (var pp in o[p])
|
||||
{
|
||||
if (pp === "p2")
|
||||
break top;
|
||||
|
||||
sum += o[p][pp];
|
||||
}
|
||||
}
|
||||
|
||||
sum += 20;
|
||||
|
||||
}
|
||||
|
||||
assert(sum === 120)
|
Loading…
Add table
Add a link
Reference in a new issue