proposal-block-params
proposal-block-params copied to clipboard
Syntactic look-a-likes?
function f(message, callback) {
console.log(message);
callback();
}
let message = "The Message";
// A
let o = {
f(message) {
console.log(message);
}
};
// B
o: {
f(message) {
console.log(message);
}
}
// C
{
f(message) {
console.log(message);
}
}
A is valid today, B and C are possible with the syntax in this proposal. The "look-a-like" problem is subjective, so maybe not a concern? I just wanted to make a record—feel free to close if this is considered "not an issue"
Good call - the block/object literal similarity seems like an issue there.
Apologies for the silly question, but just to see if I understand this correctly:
Ais an object with a propertyfthat is a functionBis a labelled block with a function callf(message, function() { ... })Cis a non-labelled block with the same function call
Is the confusion between A and B in that it is hard to tell the difference between the two?
I think it's hard to tell the difference between all of A, B, and C - especially B and C.