-
Notifications
You must be signed in to change notification settings - Fork 481
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
Reduce reliance on fnGlobalObject.js
#595
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ es5id: 15.4.4.20-9-c-iii-28 | |
description: > | ||
Array.prototype.filter - return value of callbackfn is the global | ||
object | ||
includes: [fnGlobalObject.js] | ||
---*/ | ||
|
||
var global = this; | ||
function callbackfn(val, idx, obj) { | ||
return fnGlobalObject(); | ||
return global; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this whole test seems unnecessary. It's testing a |
||
} | ||
|
||
var newArr = [11].filter(callbackfn); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,12 @@ | |
/*--- | ||
es5id: 15.4.4.15-1-17 | ||
description: Array.prototype.lastIndexOf applied to the global object | ||
includes: [fnGlobalObject.js] | ||
---*/ | ||
|
||
var targetObj = ["global"]; | ||
|
||
var oldLen = fnGlobalObject().length; | ||
fnGlobalObject()[1] = targetObj; | ||
fnGlobalObject().length = 3; | ||
var oldLen = this.length; | ||
this[1] = targetObj; | ||
this.length = 3; | ||
|
||
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); | ||
assert.sameValue(Array.prototype.lastIndexOf.call(this, targetObj), 1, 'Array.prototype.lastIndexOf.call(this, targetObj)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is another case that could be done with an ordinary object. And that's another case that shouldn't be focus of this PR. |
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 know this is not the focus for this PR but this line is unnecessary.
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.
Agreed on both counts