diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js')
-rw-r--r-- | js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js b/js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js new file mode 100644 index 0000000000..aac9c4fc1e --- /dev/null +++ b/js/src/tests/test262/intl402/NumberFormat/intl-legacy-constructed-symbol-on-unwrap.js @@ -0,0 +1,34 @@ +// Copyright 2020 Apple Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unwrapnumberformat +description: > + Tests that [[FallbackSymbol]]'s [[Description]] is "IntlLegacyConstructedSymbol" if normative optional is implemented. +author: Yusuke Suzuki +features: [intl-normative-optional] +---*/ + +let object = new Intl.NumberFormat(); +let newObject = Intl.NumberFormat.call(object); +let symbol = null; +let error = null; +try { + let proxy = new Proxy(newObject, { + get(target, property) { + symbol = property; + return target[property]; + } + }); + Intl.NumberFormat.prototype.resolvedOptions.call(proxy); +} catch (e) { + // If normative optional is not implemented, an error will be thrown. + error = e; + assert(error instanceof TypeError); +} +if (error === null) { + assert.sameValue(typeof symbol, "symbol"); + assert.sameValue(symbol.description, "IntlLegacyConstructedSymbol"); +} + +reportCompare(0, 0); |