summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js')
-rw-r--r--js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js b/js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js
new file mode 100644
index 0000000000..80885b45ce
--- /dev/null
+++ b/js/src/tests/test262/built-ins/NativeErrors/AggregateError/message-undefined-no-prop.js
@@ -0,0 +1,35 @@
+// Copyright (C) 2019 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-aggregate-error
+description: >
+ If message is undefined, no property will be set to the new instance
+info: |
+ AggregateError ( errors, message )
+
+ ...
+ 5. If message is not undefined, then
+ a. Let msg be ? ToString(message).
+ b. Perform ! CreateMethodProperty(O, "message", msg).
+ 6. Return O.
+features: [AggregateError]
+---*/
+
+var case1 = new AggregateError([], undefined);
+
+assert.sameValue(
+ Object.prototype.hasOwnProperty.call(case1, 'message'),
+ false,
+ 'explicit'
+);
+
+var case2 = new AggregateError([]);
+
+assert.sameValue(
+ Object.prototype.hasOwnProperty.call(case2, 'message'),
+ false,
+ 'implicit'
+);
+
+reportCompare(0, 0);