Closed
Bug 1374923
Opened 7 years ago
Closed 7 years ago
const redeclaration error
Categories
(DevTools Graveyard :: Scratchpad, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: amitchawla777, Unassigned)
Details
Attachments
(1 file)
81.37 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0 Build ID: 20170608105825 Steps to reproduce: const MY_CONST = { 'key': 'value' }; MY_CONST.key = 'other value'; Actual results: /* Exception: SyntaxError: redeclaration of const MY_CONST @Scratchpad/1:1:1 */ Expected results: it should change the value of key to 'other value', because as the per the documentation on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types it should change the value (as per the attached screen shot), it is working correctly in chrome console.
Updated•7 years ago
|
Component: Untriaged → Developer Tools: Scratchpad
Comment 1•7 years ago
|
||
what's the exact steps do you follow? you're typing it in Scratchpad, right? did you hit "Run" twice? Scratchpad evaluates entire code in the same environment every time you hit "Run". possible situation that you get the redeclaration error is the following: 1. write "const MY_CONST = { 'key': 'value' };" 2. hit "Run" 3. write "MY_CONST.key = 'other value';" in the next line 4. hit "Run" in that case, "const MY_CONST = { 'key': 'value' };" is evaluated twice, and it results in redeclaration. if your case isn't above, please describe the detailed steps.
Flags: needinfo?(amitchawla777)
Comment 2•7 years ago
|
||
also, if you want console, you can use Web Console. https://developer.mozilla.org/en-US/docs/Tools/Web_Console
Comment 3•7 years ago
|
||
Closing due to lack of response. Feel free to reopen with more information (asked in comment #1).
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(amitchawla777)
Resolution: --- → INCOMPLETE
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•4 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•