File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2
2
if ( ! String . prototype . codePointAt ) {
3
3
( function ( ) {
4
4
'use strict' ; // needed to support `apply`/`call` with `undefined`/`null`
5
+ var defineProperty = ( function ( ) {
6
+ // IE 8 only supports `Object.defineProperty` on DOM elements
7
+ try {
8
+ var object = { } ;
9
+ var $defineProperty = Object . defineProperty ;
10
+ var result = $defineProperty ( object , object , object ) && $defineProperty ;
11
+ } catch ( error ) { }
12
+ return result ;
13
+ } ( ) ) ;
5
14
var codePointAt = function ( position ) {
6
15
if ( this == null ) {
7
16
throw TypeError ( ) ;
@@ -32,8 +41,8 @@ if (!String.prototype.codePointAt) {
32
41
}
33
42
return first ;
34
43
} ;
35
- if ( Object . defineProperty ) {
36
- Object . defineProperty ( String . prototype , 'codePointAt' , {
44
+ if ( defineProperty ) {
45
+ defineProperty ( String . prototype , 'codePointAt' , {
37
46
'value' : codePointAt ,
38
47
'configurable' : true ,
39
48
'writable' : true
You can’t perform that action at this time.
0 commit comments