ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Fix error message for changing [[Writable]] to true from false for non-configurable properties

Open rajatd opened this issue 10 years ago • 4 comments

Currently the error message we print is "Cannot modify non-writable property" while it should be "Cannot redefine non-configurable property"

rajatd avatar Mar 01 '16 20:03 rajatd

It might be useful to say something more specific like "Cannot make nonconfigurable property writable" when attempting to set writable to true - to highlight the difference where you can change it to false.

ljharb avatar Mar 01 '16 20:03 ljharb

Thanks @ljharb . Sure, we could have that. However, we have a macro for the error message to be thrown when trying to redefine non-configurable properties (except for the cases where it is allowed). Having a different one just for this case doesn't really seem worth it. Other browsers also just say "cannot redefine....".

rajatd avatar Mar 01 '16 21:03 rajatd

Fair. I'd say every error message should be as helpful as possible, even if other browsers don't live up to that standard, but I don't truly understand the tradeoffs there.

ljharb avatar Mar 01 '16 22:03 ljharb

Not enough impact to add to 1.4.1

EdMaurer avatar Dec 27 '16 22:12 EdMaurer