Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /domxpath/variables-in-expression-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<head>
<meta name="assert" content="Using variables in xpath expression should not crash.">
</head>
<body>
<script>
// The exact behaviour here is not defined. Firefox throws an error, Chrome doesn't.
// None of these should cause a renderer crash.
try { document.evaluate("$foo", document.createElement("div")); } catch {}
try { document.evaluate("any[$any]", document.createElement("div")); } catch {}
</script>
</body>