forked from marmelab/admin-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
marmelab#57 Fix for..in bug, add tests to guard against regressions.
- Loading branch information
1 parent
5fb0e6c
commit b821168
Showing
8 changed files
with
46 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
beforeEach(function() { | ||
if (!Object.prototype.test_prototype_entry) { | ||
Object.prototype.test_prototype_entry = | ||
"Don't use for..in to enumerate Object properties, as users are free to " + | ||
"add entries to the Object prototype, for example for polyfills. " + | ||
"You should instead use\n" + | ||
" for (let i in xs) { if (!xs.hasOwnProperty(i)) continue; var x = xs[i]; ... }"; | ||
} | ||
|
||
if (!Array.prototype.test_prototype_entry) { | ||
Array.prototype.test_prototype_entry = | ||
"Don't use for..in to enumerate Array properties, as users are free to " + | ||
"add entries to the Array prototype, for example for polyfills. " + | ||
"You should instead use\n" + | ||
" for (let i in xs) { if (!xs.hasOwnProperty(i)) continue; var x = xs[i]; ... }\n" + | ||
"or\n" + | ||
" for (let x of xs) { ... }"; | ||
} | ||
}); |