-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outsource magic error messages #4821
Outsource magic error messages #4821
Conversation
a0c7c39
to
1085deb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good patch. Are these strings available as magic strings? Since they are part of the binary anyway, there should be no memory allocation when these strings are used in JS code.
After #4816, parser errors should be externalized as well. |
85e6ee5
to
c821851
Compare
PR was refreshed: Generate error messages with magic strings using the same ini file. |
c821851
to
21ddd03
Compare
dd02d98
to
749773a
Compare
749773a
to
949b21a
Compare
949b21a
to
82bbba3
Compare
The PR is updated. |
82bbba3
to
dafd543
Compare
jerry-core/ecma/base/ecma-errors.h
Outdated
#include "ecma-error-messages.inc.h" | ||
#undef ECMA_ERROR_DEF | ||
/** @endcond */ | ||
ECMA_IS_VALID_CONSTRUCTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok tho have this here? I don't see a relevant entry in the .c file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in ecma-function-object.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, could we add a comment here why is this needed? (maybe where it is used?)
dafd543
to
0cb587d
Compare
56bf3e3
to
a8c3af5
Compare
jerry-core/ecma/base/ecma-errors.h
Outdated
#include "ecma-error-messages.inc.h" | ||
#undef ECMA_ERROR_DEF | ||
/** @endcond */ | ||
ECMA_IS_VALID_CONSTRUCTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, could we add a comment here why is this needed? (maybe where it is used?)
12b2a29
to
2d931a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change request, otherwise lgtm
jerry-core/ecma/base/ecma-errors.c
Outdated
#endif /* JERRY_ERROR_MESSAGES */ | ||
|
||
/** | ||
* Error message, Cannot allocate memory for literals | ||
*/ | ||
const char* const ecma_error_cannot_allocate_memory_literals = "Cannot allocate memory for literals"; | ||
} /* ecma_get_error_utf8 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this newline always here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
Modify tools/gen-magic-strings.py to generate error messages. JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
2d931a4
to
e375f03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Modify tools/gen-magic-strings.py to generate error messages.
JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]