Skip to content

Commit f76e262

Browse files
committed
Adding a regression test for the incorrect unwrapping of OptionalChainNode.
1 parent 93b47a7 commit f76e262

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
*/
7+
8+
load('assert.js');
9+
10+
var argumentsEvaluated = false;
11+
var f = function () {
12+
argumentsEvaluated = true;
13+
};
14+
assertThrows(function () {
15+
(undefined?.foo)(f());
16+
}, TypeError);
17+
assertSame(true, argumentsEvaluated);
18+
19+
true;

0 commit comments

Comments
 (0)