| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <title>Const test</title> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body id="bodyId"> |
| |
| <script> |
| |
| description( |
| "This test checks that const variables can't shadow global object properties. Note that this test expects SyntaxErrors in below <script>" |
| ); |
| |
| let sentinel = "__s__"; |
| </script> |
| |
| <script> |
| // Make sure we can't override properties placed on the global object |
| const bodyId = "lah la lah la lah, I should never execute."; |
| sentinel = "bad"; |
| </script> |
| |
| <script> |
| shouldBe("sentinel", '"__s__"'); |
| shouldBe("bodyId", "document.getElementById('bodyId')"); |
| successfullyParsed = true; |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |