guest271314 (2019-06-15T05:03:11.000Z)
guest271314 at gmail.com (2019-06-15T05:45:49.061Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` if is ```undefined``` an error ```Uncaught ReferenceError: Cannot access 'y' before initialization``` is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is an emphasized portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to meet requirements. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which propose for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:19:09.940Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is an emphasized portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to meet requirements. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which propose for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:18:54.199Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is an emphasized portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to meet requirements. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which propose and advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:18:17.678Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is an emphasized portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to meet requirements. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:17:12.123Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to meet requirements. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:15:55.820Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. Though do not object to extending code (language) to perform the required task. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:13:59.581Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all before being referenced at ```nameof y; // "y"```? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:13:03.071Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though focus be placed on on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:11:43.066Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though concentrate on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or coding value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:11:02.728Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though concentrate on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated very basic features into gedit for HTML templates. Now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. Should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition. As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves?
guest271314 at gmail.com (2019-06-15T05:07:57.969Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though concentrate on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. Some time ago incorporated features into gedit for HTML templates; should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition; now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. To each their own. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves? As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor.
guest271314 at gmail.com (2019-06-15T05:05:42.562Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though concentrate on coercing a name from a different potentially undefined property? > Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof``` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. FWIW, some time ago incorporated features into gedit for HTML templates; should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition; now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. To each their own. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves? As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor.
guest271314 at gmail.com (2019-06-15T05:05:22.805Z)
> I’m not sure I understand what you mean by “false-positive” in this instance. Was referring to ``` const x = nameof y; // "y" const y = 1; ``` Where ```y``` is ```undefined``` an error is not expected to be thrown? Is ```y``` declared globally, using ```const``` or ```let```, or not at all? The use case described by OP ``` function func1(param1, param2, param3, userName, param4, param5) { if (userName == undefined) { throw new ArgumentNullError(nameof userName); // `ArgumentNullError` is a custom error, derived from `Error`, composes error message like "Argument cannot be null: userName". } ``` checks if ```userName``` was ```undefined``` before using ```nameof```. If error checking is a substantial portion of the proposal, why should an error (```y``` being ```undefined``` though referenced) be ignored when referencing an undefined identifier though concentrate on coercing a name from a different potentially undefined property? Consider this case: > ``` > const someObject = { value: 1 }; > function setValue(value /*1*/) { > if (typeof value /*2*/ !== "number") throw new TypeError(`Number > expected: ${nameof value /*3*/}`); > someObject["value" /*4*/] = value /*5*/; > } > ``` > > If you rename the parameter `value` of the function `setValue` in an editor > with a rename refactoring, you want to rename the symbols at 1, 2, 3, and > 5, but not the string at 4. Not gathering the purpose or value of ```nameof``` usage in that case. If the value is not a "number" then why does the value or name matter? Since the primary use case appears to be an editor environment, why cannot the editor be programmed to recognize the custom JavaScript ```nameof```` function or operator? Then it would not matter if this board concurred with the ```nameof``` functionality or not. Both CLI and GUI editors (and JavaScript) are generally extensible. FWIW, some time ago incorporated features into gedit for HTML templates; should be a similar process to create custom scripts for the various editor environments where users rely on such programs for code composition; now simply write the code by hand and test in different environments, without taking the time to customize or rely on an editor - take the time to test the code where the code will actually be run where errors, if any, can be evaluated in the context in which a specific output is expected. To each their own. What needs to be implemented outside of what the users which advocate for ```nameof``` cannot implement themselves? As mentioned earlier do not rely on "an editor with name refactoring" to compose code. The code has to be tested (outside of the editor environments) anyway. Test the code itself, here, not the editor.