From ca0141284894ebd838fe5a293c5f3796ef0dc102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Lang=C3=B3?= Date: Mon, 8 Feb 2016 12:21:16 +0100 Subject: [PATCH] Add regression tests for recently closed issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related issues: #123, #354, #358, #384, #447, #680, #738, #739, #743, #781, #785, #786 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com --- .../jerry/fail/1/regression-test-issue-358.js | 20 ++++++++ .../jerry/fail/1/regression-test-issue-384.js | 29 +++++++++++ tests/jerry/regression-test-issue-123.js | 24 +++++++++ tests/jerry/regression-test-issue-354.js | 50 +++++++++++++++++++ tests/jerry/regression-test-issue-447.js | 25 ++++++++++ tests/jerry/regression-test-issue-680.js | 28 +++++++++++ tests/jerry/regression-test-issue-738.js | 16 ++++++ tests/jerry/regression-test-issue-739.js | 42 ++++++++++++++++ tests/jerry/regression-test-issue-743.js | 16 ++++++ tests/jerry/regression-test-issue-781.js | 26 ++++++++++ tests/jerry/regression-test-issue-785.js | 19 +++++++ tests/jerry/regression-test-issue-786.js | 43 ++++++++++++++++ 12 files changed, 338 insertions(+) create mode 100644 tests/jerry/fail/1/regression-test-issue-358.js create mode 100644 tests/jerry/fail/1/regression-test-issue-384.js create mode 100644 tests/jerry/regression-test-issue-123.js create mode 100644 tests/jerry/regression-test-issue-354.js create mode 100644 tests/jerry/regression-test-issue-447.js create mode 100644 tests/jerry/regression-test-issue-680.js create mode 100644 tests/jerry/regression-test-issue-738.js create mode 100644 tests/jerry/regression-test-issue-739.js create mode 100644 tests/jerry/regression-test-issue-743.js create mode 100644 tests/jerry/regression-test-issue-781.js create mode 100644 tests/jerry/regression-test-issue-785.js create mode 100644 tests/jerry/regression-test-issue-786.js diff --git a/tests/jerry/fail/1/regression-test-issue-358.js b/tests/jerry/fail/1/regression-test-issue-358.js new file mode 100644 index 000000000..afa9234cc --- /dev/null +++ b/tests/jerry/fail/1/regression-test-issue-358.js @@ -0,0 +1,20 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +label_0: + if (false) + do { + continue label_0; + } while (false); \ No newline at end of file diff --git a/tests/jerry/fail/1/regression-test-issue-384.js b/tests/jerry/fail/1/regression-test-issue-384.js new file mode 100644 index 000000000..b019f3e03 --- /dev/null +++ b/tests/jerry/fail/1/regression-test-issue-384.js @@ -0,0 +1,29 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +// Copyrnse. + +'use stricto +// C_pyrnsq. + +'use strictI +// Copyrnse. Functionn f_0(){ + 'use strictT +// Copyrnse. + +'use strict) +// Copyrnse. + +'use strict; \ No newline at end of file diff --git a/tests/jerry/regression-test-issue-123.js b/tests/jerry/regression-test-issue-123.js new file mode 100644 index 000000000..964723caa --- /dev/null +++ b/tests/jerry/regression-test-issue-123.js @@ -0,0 +1,24 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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 v_1 = (1 + (1 + (1 + + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + + 1 + )) )) )) )) )) )) )) )) )) )) + )) )) )) )) )) )) )) )) )) )) + )) )) )) )) )) )) )) )) )) )) + )) ); diff --git a/tests/jerry/regression-test-issue-354.js b/tests/jerry/regression-test-issue-354.js new file mode 100644 index 000000000..126fd99d3 --- /dev/null +++ b/tests/jerry/regression-test-issue-354.js @@ -0,0 +1,50 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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 data = { +'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': '', '38': '', '39': '', '40': '', +'41': '', '42': '', '43': '', '44': '', '45': '', '46': '', '47': '', '48': '', +'49': '', '50': '', '51': '', '52': '', '53': '', '54': '', '55': '', '56': '', +'57': '', '58': '', '59': '', '60': '', '61': '', '62': '', '63': '', '64': '', +'65': '', '66': '', '67': '', '68': '', '69': '', '70': '', '71': '', '72': '', +'73': '', '74': '', '75': '', '76': '', '77': '', '78': '', '79': '', '80': '', +'81': '', '82': '', '83': '', '84': '', '85': '', '86': '', '87': '', '88': '', +'89': '', '90': '', '91': '', '92': '', '93': '', '94': '', '95': '', '96': '', +'97': '', '98': '', '99': '', '100': '', '101': '', '102': '', '103': '', '104': '', +'105': '', '106': '', '107': '', '108': '', '109': '', '110': '', '111': '', '112': '', +'113': '', '114': '', '115': '', '116': '', '117': '', '118': '', '119': '', '120': '', +'121': '', '122': '', '123': '', '124': '', '125': '', '126': '', '127': '', '128': '', +'129': '', '130': '', '131': '', '132': '', '133': '', '134': '', '135': '', '136': '', +'137': '', '138': '', '139': '', '140': '', '141': '', '142': '', '143': '', '144': '', +'145': '', '146': '', '147': '', '148': '', '149': '', '150': '', '151': '', '152': '', +'153': '', '154': '', '155': '', '156': '', '157': '', '158': '', '159': '', '160': '', +'161': '', '162': '', '163': '', '164': '', '165': '', '166': '', '167': '', '168': '', +'169': '', '170': '', '171': '', '172': '', '173': '', '174': '', '175': '', '176': '', +'177': '', '178': '', '179': '', '180': '', '181': '', '182': '', '183': '', '184': '', +'185': '', '186': '', '187': '', '188': '', '189': '', '190': '', '191': '', '192': '', +'193': '', '194': '', '195': '', '196': '', '197': '', '198': '', '199': '', '200': '', +'201': '', '202': '', '203': '', '204': '', '205': '', '206': '', '207': '', '208': '', +'209': '', '210': '', '211': '', '212': '', '213': '', '214': '', '215': '', '216': '', +'217': '', '218': '', '219': '', '220': '', '221': '', '222': '', '223': '', '224': '', +'225': '', '226': '', '227': '', '228': '', '229': '', '230': '', '231': '', '232': '', +'233': '', '234': '', '235': '', '236': '', '237': '', '238': '', '239': '', '240': '', +'241': '', '242': '', '243': '', '244': '', '245': '', '246': '', '247': '', '248': '', +'249': '', '250': '', '251': '', '252': '', '253': '', '254': '', '255': '', +'256': '', +}; diff --git a/tests/jerry/regression-test-issue-447.js b/tests/jerry/regression-test-issue-447.js new file mode 100644 index 000000000..788333da9 --- /dev/null +++ b/tests/jerry/regression-test-issue-447.js @@ -0,0 +1,25 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try +{ + for (v_0 in v_1) {}; + f_0(v_2.v_3 === 5); + assert (false); +} +catch (e) +{ + assert (e instanceof ReferenceError); +} diff --git a/tests/jerry/regression-test-issue-680.js b/tests/jerry/regression-test-issue-680.js new file mode 100644 index 000000000..ff90519ed --- /dev/null +++ b/tests/jerry/regression-test-issue-680.js @@ -0,0 +1,28 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try +{ + f1(function(a1){}); + assert (false); +} +catch (e) +{ + assert (e instanceof ReferenceError); +} + +var x = { +foo: function () { throw new TypeError("bar"); } +}; diff --git a/tests/jerry/regression-test-issue-738.js b/tests/jerry/regression-test-issue-738.js new file mode 100644 index 000000000..d54b1a8d4 --- /dev/null +++ b/tests/jerry/regression-test-issue-738.js @@ -0,0 +1,16 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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 g() {};for (B in Boolean) print(f); diff --git a/tests/jerry/regression-test-issue-739.js b/tests/jerry/regression-test-issue-739.js new file mode 100644 index 000000000..3385cec71 --- /dev/null +++ b/tests/jerry/regression-test-issue-739.js @@ -0,0 +1,42 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try { + var res = RegExp.prototyj_l; + obj_l = obj; + + for (var k = 0; k < 1500; k++) + { + obj_l.prop = {}; + obj_l = obj_l.prop; + } + + function f (f, i) { + if (--i > 0) { + f ({a:o, b:o}, i); + } + } + + for (var i = 0; i < 100; i++) + { + ({} + f ({}, 12)); + } + + assert (false); +} +catch (e) +{ + assert (e instanceof ReferenceError); +} diff --git a/tests/jerry/regression-test-issue-743.js b/tests/jerry/regression-test-issue-743.js new file mode 100644 index 000000000..174abee4a --- /dev/null +++ b/tests/jerry/regression-test-issue-743.js @@ -0,0 +1,16 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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 Error(Error) { } diff --git a/tests/jerry/regression-test-issue-781.js b/tests/jerry/regression-test-issue-781.js new file mode 100644 index 000000000..547f47994 --- /dev/null +++ b/tests/jerry/regression-test-issue-781.js @@ -0,0 +1,26 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try +{ + Function (Array.isArray); + assert (false); +} +catch (e) +{ + assert (e instanceof SyntaxError); +} + +try { Function(TypeError.prototype) } catch (err) { } diff --git a/tests/jerry/regression-test-issue-785.js b/tests/jerry/regression-test-issue-785.js new file mode 100644 index 000000000..43d846799 --- /dev/null +++ b/tests/jerry/regression-test-issue-785.js @@ -0,0 +1,19 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try { RegExp.prototype.toString() } catch (err) { } +try { isNaN.apply(unescape, JSON.stringify) } catch (err) { } +try { Array.prototype.forEach(eval) } catch (err) { } +try { RegExp.prototype.compile(RegExp.prototype) } catch (err) { } diff --git a/tests/jerry/regression-test-issue-786.js b/tests/jerry/regression-test-issue-786.js new file mode 100644 index 000000000..2327947f5 --- /dev/null +++ b/tests/jerry/regression-test-issue-786.js @@ -0,0 +1,43 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// 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. + +try { RegExp.prototype.toString() } catch (err) { } +try { Date.prototype.toTimeString() } catch (err) { } +try { Boolean.prototype.toString() } catch (err) { } +try { String.prototype.match(isNaN) } catch (err) { } +try { Math.round(Math.atan) } catch (err) { } +try { Date.prototype.getUTCDay() } catch (err) { } +try { toLocaleString() } catch (err) { } +try { Array.prototype.join(String.prototype.split) } catch (err) { } +try { Date.prototype.getSeconds() } catch (err) { } +try { isNaN.apply(Date.prototype.toISOString, String.prototype.split) } catch (err) { } +try { Math.cos(Object) } catch (err) { } +try { Math.floor(Date.prototype.getUTCSeconds) } catch (err) { } +try { isNaN.apply(assert, JSON.stringify) } catch (err) { } +try { Number.prototype.toLocaleString() } catch (err) { } +try { Date.prototype.getTimezoneOffset() } catch (err) { } +try { Date.prototype.setMinutes(Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames) } catch (err) { } +try { Math.log(String.prototype.search) } catch (err) { } +try { ReferenceError(Object.defineProperty) } catch (err) { } +try { Array.prototype.filter(Number.prototype.toLocaleString) } catch (err) { } +try { Array.prototype.forEach(Date.prototype.getDay) } catch (err) { } +try { Object.defineProperty(SyntaxError.prototype, Date.prototype.setUTCMinutes, Math.max) } catch (err) { } +try { Date.prototype.setMilliseconds(String.prototype.localeCompare) } catch (err) { } +try { Math.asin(Date.prototype.getDay) } catch (err) { } +try { Array.prototype.some(Date.prototype.getDay) } catch (err) { } +try { String.prototype.charCodeAt(toString) } catch (err) { } +try { isPrototypeOf(Math.tan) } catch (err) { } +try { Object.isFrozen(print) } catch (err) { } +try { RegExp.prototype.compile(RegExp.prototype) } catch (err) { }