diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-03-21 10:16:54 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-03-25 09:44:10 +0100 |
commit | c459d8ea5d402c702948c860d9497b2230ff7e8a (patch) | |
tree | 56c282fc4d40e5cb613b47cf7be3ea0526ed5b6f /deps/v8/test/test262/local-tests | |
parent | e0bc5a7361b1d29c3ed034155fd779ce6f44fb13 (diff) | |
download | node-new-c459d8ea5d402c702948c860d9497b2230ff7e8a.tar.gz |
deps: update V8 to 5.7.492.69
PR-URL: https://github.com/nodejs/node/pull/11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'deps/v8/test/test262/local-tests')
-rw-r--r-- | deps/v8/test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js | 42 | ||||
-rw-r--r-- | deps/v8/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js | 42 |
2 files changed, 84 insertions, 0 deletions
diff --git a/deps/v8/test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js b/deps/v8/test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js new file mode 100644 index 0000000000..ef843d4bb4 --- /dev/null +++ b/deps/v8/test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js @@ -0,0 +1,42 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 12.1.1_1 +description: Tests that the this-value is ignored in DateTimeFormat. +author: Norbert Lindenberg +includes: [testIntl.js] +---*/ + +testWithIntlConstructors(function (Constructor) { + var obj, newObj; + + if (Constructor === Intl.DateTimeFormat) { + obj = new Constructor(); + newObj = Intl.DateTimeFormat.call(obj); + if (obj !== newObj) { + $ERROR("Should have modified existing object."); + } + var key = Object.getOwnPropertySymbols(newObj)[0]; + if (!(newObj[key] instanceof Intl.DateTimeFormat)) { + $ERROR("Should have installed a DateTimeFormat instance."); + } + return true; + } + + // variant 1: use constructor in a "new" expression + obj = new Constructor(); + newObj = Intl.DateTimeFormat.call(obj); + if (obj === newObj) { + $ERROR("DateTimeFormat object created with \"new\" was not ignored as this-value."); + } + + // variant 2: use constructor as a function + obj = Constructor(); + newObj = Intl.DateTimeFormat.call(obj); + if (obj === newObj) { + $ERROR("DateTimeFormat object created with constructor as function was not ignored as this-value."); + } + + return true; +}); diff --git a/deps/v8/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js b/deps/v8/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js new file mode 100644 index 0000000000..2d42609acb --- /dev/null +++ b/deps/v8/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js @@ -0,0 +1,42 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 11.1.1_1 +description: Tests that the this-value is ignored in NumberFormat. +author: Norbert Lindenberg +includes: [testIntl.js] +---*/ + +testWithIntlConstructors(function (Constructor) { + var obj, newObj; + + if (Constructor === Intl.NumberFormat) { + obj = new Constructor(); + newObj = Intl.NumberFormat.call(obj); + if (obj !== newObj) { + $ERROR("Should have modified existing object."); + } + var key = Object.getOwnPropertySymbols(newObj)[0]; + if (!(newObj[key] instanceof Intl.NumberFormat)) { + $ERROR("Should have installed a NumberFormat instance."); + } + return true; + } + + // variant 1: use constructor in a "new" expression + obj = new Constructor(); + newObj = Intl.NumberFormat.call(obj); + if (obj === newObj) { + $ERROR("NumberFormat object created with \"new\" was not ignored as this-value."); + } + + // variant 2: use constructor as a function + obj = Constructor(); + newObj = Intl.NumberFormat.call(obj); + if (obj === newObj) { + $ERROR("NumberFormat object created with constructor as function was not ignored as this-value."); + } + + return true; +}); |