forked from DevExpress/testcafe-hammerhead
-
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.
…DevExpress#1209) (DevExpress#1206) * mark all internal properties as non-enumerable (close DevExpress#1182) * fix tests
- Loading branch information
1 parent
ec301a5
commit 13d0a6a
Showing
6 changed files
with
42 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
test('mark all internal properties as non-enumerable (GH-1182)', function () { | ||
var documentEnumerableProperties = Object.keys(document); | ||
var windowEnumerableProperties = Object.keys(window); | ||
var elementEnumerableProperties = Object.keys(document.body); | ||
var hasEnumerableInternalProperty = function (propName) { | ||
// Used for tests | ||
if (propName === 'hammerhead') | ||
return false; | ||
|
||
return propName.indexOf('hammerhead') !== -1; | ||
}; | ||
|
||
for (var i = 0; i < documentEnumerableProperties.length; i++) { | ||
var documentEnumerableProperty = documentEnumerableProperties[i]; | ||
|
||
ok(!hasEnumerableInternalProperty(documentEnumerableProperty), documentEnumerableProperty); | ||
} | ||
|
||
for (var j = 0; j < windowEnumerableProperties.length; j++) { | ||
var windowEnumerableProperty = windowEnumerableProperties[j]; | ||
|
||
ok(!hasEnumerableInternalProperty(windowEnumerableProperty), windowEnumerableProperty); | ||
} | ||
|
||
for (var k = 0; k < elementEnumerableProperties.length; k++) { | ||
var elementEnumerableProperty = elementEnumerableProperties[k]; | ||
|
||
ok(!hasEnumerableInternalProperty(elementEnumerableProperty), elementEnumerableProperty); | ||
} | ||
}); | ||
|