rhino/testsrc/doctests/423557.doctest
raw| 1 | // This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | |
| 5 | // Test for using keywords as identifiers |
| 6 | // https://bugzilla.mozilla.org/show_bug.cgi?id=423557 |
| 7 | js> var x = {if: 1} |
| 8 | js> x.if |
| 9 | 1 |
| 10 | js> x.function = 3 |
| 11 | 3 |
| 12 | js> x.if + x.function |
| 13 | 4 |
| 14 | js> delete x.if |
| 15 | true |
| 16 | js> x.if |