Skip to content

Conversation

gbrail
Copy link
Collaborator

@gbrail gbrail commented Oct 22, 2021

This fixes problems with null "this" parameters in:

Function.prototype.call
Function.prototype.apply
Function.prototype.toString
Object.prototype.toLocaleString

This addresses all but one of the NPEs in:

Closes #988

This fixes problems with null "this" parameters in:

Function.prototype.call
Function.prototype.apply
Function.prototype.toString
Object.prototype.toLocaleString

This addresses all but one of the NPEs in:

#988
@p-bakker
Copy link
Collaborator

Looks good to me!

@@ -4367,7 +4369,8 @@ public static Scriptable newObjectLiteral(
Context cx,
Scriptable scope) {
Scriptable object = cx.newObject(scope);
for (int i = 0, end = propertyIds.length; i != end; ++i) {
int idCount = propertyIds == null ? 0 : propertyIds.length;
for (int i = 0, end = idCount; i != end; ++i) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess we can simplify this like

end = propertyIds == null ? 0 : propertyIds.length;
for (int i = 0; i != end; ++i) {

@gbrail gbrail merged commit 2937a45 into master Nov 1, 2021
@gbrail gbrail deleted the greg-fix-npe branch November 1, 2021 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More nullPointers while running test262
3 participants