Skip to content

Commit

Permalink
[Fix] GetIntrinsic: IE 8 has a broken `Object.getOwnPropertyDescrip…
Browse files Browse the repository at this point in the history
…tor`
  • Loading branch information
ljharb committed Dec 20, 2019
1 parent fb308ec commit c52fa59
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GetIntrinsic.js
Expand Up @@ -10,6 +10,13 @@ var undefined;
var $TypeError = TypeError;

var $gOPD = Object.getOwnPropertyDescriptor;
if ($gOPD) {
try {
$gOPD({}, '');
} catch (e) {
$gOPD = null; // this is IE 8, which has a broken gOPD
}
}

var throwTypeError = function () { throw new $TypeError(); };
var ThrowTypeError = $gOPD
Expand Down

0 comments on commit c52fa59

Please sign in to comment.