summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js')
-rw-r--r--js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js b/js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js
new file mode 100644
index 0000000000..e57b9345ff
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/defineProperty/S15.2.3.6_A1.js
@@ -0,0 +1,38 @@
+// Copyright 2011 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If a particular API exists (document.createElement, as happens to
+ exist in a browser environment), check if the form objects it makes
+ obey the constraints that even host objects must obey. In this
+ case, that if defineProperty seems to have successfully installed a
+ non-configurable getter, that it is still there.
+es5id: 15.2.3.6_A1
+description: Do getters on HTMLFormElements disappear?
+---*/
+
+function getter() {
+ return 'gotten';
+}
+
+if (typeof document !== 'undefined' &&
+ typeof document.createElement === 'function') {
+ var f = document.createElement("form");
+ var refused = false;
+ try {
+ Object.defineProperty(f, 'foo', {
+ get: getter,
+ set: void 0
+ });
+ } catch (err) {
+ // A host object may refuse to install the getter
+ refused = true;
+ }
+ if (!refused) {
+ var desc = Object.getOwnPropertyDescriptor(f, 'foo');
+ assert.sameValue(desc.get, getter, 'The value of desc.get is expected to equal the value of getter');
+ }
+}
+
+reportCompare(0, 0);