-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix non-enumerable integer keys issue in Nashorn ~ JDK8 bug, close #389
- Loading branch information
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
packages/core-js/internals/object-property-is-enumerable.js
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 |
---|---|---|
@@ -1 +1,11 @@ | ||
exports.f = {}.propertyIsEnumerable; | ||
'use strict'; | ||
var nativePropertyIsEnumerable = {}.propertyIsEnumerable; | ||
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; | ||
|
||
// Nashorn ~ JDK8 bug | ||
var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); | ||
|
||
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { | ||
var descriptor = nativeGetOwnPropertyDescriptor(this, V); | ||
return !!descriptor && descriptor.enumerable; | ||
} : nativePropertyIsEnumerable; |
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