V
VK
Now try this:
Evidently the interpreter thinks that new Array(a,b,c) and [a,b,c] are
all different creatures: on the eval block it gives "illegal left-hand
side assignment".
Now comment the try-catch with eval and uncomment the second try-catch
with the direct assignment. The "illegal left-hand side assignment" is
still here, but now it is a syntax error, not a run-time one anymore.
No code is executed, you have to look the error console for the
message. So I don't care what is written in JavaScript1.7 changes, but
the real thought of the author of these changes should be close to
what I said and quoted again at the top of this message.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script>
var a,b,c;
try {
[a,b,c] = [1,2,3];
window.alert(a);
}
catch(e) {
window.alert('[a,b,c] '+e.message);
}
try {
eval("new Array(a,b,c) = new Array(1,2,3)");
window.alert(a);
}
catch(e) {
window.alert('new Array '+e.message);
}
//try {
// new Array(a,b,c) = new Array(1,2,3);
// window.alert(a);
//}
//catch(e) {
// window.alert('new Array '+e.message);
//}
</script>
</head>
<body>
</body>
</html>
Evidently the interpreter thinks that new Array(a,b,c) and [a,b,c] are
all different creatures: on the eval block it gives "illegal left-hand
side assignment".
Now comment the try-catch with eval and uncomment the second try-catch
with the direct assignment. The "illegal left-hand side assignment" is
still here, but now it is a syntax error, not a run-time one anymore.
No code is executed, you have to look the error console for the
message. So I don't care what is written in JavaScript1.7 changes, but
the real thought of the author of these changes should be close to
what I said and quoted again at the top of this message.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script>
var a,b,c;
try {
[a,b,c] = [1,2,3];
window.alert(a);
}
catch(e) {
window.alert('[a,b,c] '+e.message);
}
try {
eval("new Array(a,b,c) = new Array(1,2,3)");
window.alert(a);
}
catch(e) {
window.alert('new Array '+e.message);
}
//try {
// new Array(a,b,c) = new Array(1,2,3);
// window.alert(a);
//}
//catch(e) {
// window.alert('new Array '+e.message);
//}
</script>
</head>
<body>
</body>
</html>