@@ -59,93 +59,80 @@ var methods = [
59
59
} ,
60
60
{
61
61
name : 'isArrayBufferView' ,
62
- supported : supported . ArrayBuffer ,
63
62
function : function isArrayBufferView ( value ) {
64
- return ArrayBuffer . isView ( value ) ;
63
+ return supported . ArrayBuffer && ArrayBuffer . isView ( value ) ;
65
64
} ,
66
65
} ,
67
66
{
68
67
name : 'isTypedArray' ,
69
- supported : supported . Uint8Array ,
70
68
function : function isTypedArray ( value ) {
71
- return TypedArrayProto_toStringTag ( value ) !== undefined ;
69
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) !== undefined ;
72
70
}
73
71
} ,
74
72
{
75
73
name : 'isUint8Array' ,
76
- supported : supported . Uint8Array ,
77
74
function : function isUint8Array ( value ) {
78
- return TypedArrayProto_toStringTag ( value ) === 'Uint8Array' ;
75
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Uint8Array' ;
79
76
}
80
77
} ,
81
78
{
82
79
name : 'isUint8ClampedArray' ,
83
- supported : supported . Uint8Array ,
84
80
function : function isUint8ClampedArray ( value ) {
85
- return TypedArrayProto_toStringTag ( value ) === 'Uint8ClampedArray' ;
81
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Uint8ClampedArray' ;
86
82
}
87
83
} ,
88
84
{
89
85
name : 'isUint16Array' ,
90
- supported : supported . Uint8Array ,
91
86
function : function isUint16Array ( value ) {
92
- return TypedArrayProto_toStringTag ( value ) === 'Uint16Array' ;
87
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Uint16Array' ;
93
88
}
94
89
} ,
95
90
{
96
91
name : 'isUint32Array' ,
97
- supported : supported . Uint8Array ,
98
92
function : function isUint32Array ( value ) {
99
- return TypedArrayProto_toStringTag ( value ) === 'Uint32Array' ;
93
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Uint32Array' ;
100
94
}
101
95
} ,
102
96
{
103
97
name : 'isInt8Array' ,
104
- supported : supported . Uint8Array ,
105
98
function : function isInt8Array ( value ) {
106
- return TypedArrayProto_toStringTag ( value ) === 'Int8Array' ;
99
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Int8Array' ;
107
100
}
108
101
} ,
109
102
{
110
103
name : 'isInt16Array' ,
111
- supported : supported . Uint8Array ,
112
104
function : function isInt16Array ( value ) {
113
- return TypedArrayProto_toStringTag ( value ) === 'Int16Array' ;
105
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Int16Array' ;
114
106
}
115
107
} ,
116
108
{
117
109
name : 'isInt32Array' ,
118
- supported : supported . Uint8Array ,
119
110
function : function isInt32Array ( value ) {
120
- return TypedArrayProto_toStringTag ( value ) === 'Int32Array' ;
111
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Int32Array' ;
121
112
}
122
113
} ,
123
114
{
124
115
name : 'isFloat32Array' ,
125
- supported : supported . Uint8Array ,
126
116
function : function isFloat32Array ( value ) {
127
- return TypedArrayProto_toStringTag ( value ) === 'Float32Array' ;
117
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Float32Array' ;
128
118
}
129
119
} ,
130
120
{
131
121
name : 'isFloat64Array' ,
132
- supported : supported . Uint8Array ,
133
122
function : function isFloat64Array ( value ) {
134
- return TypedArrayProto_toStringTag ( value ) === 'Float64Array' ;
123
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'Float64Array' ;
135
124
}
136
125
} ,
137
126
{
138
127
name : 'isBigInt64Array' ,
139
- supported : supported . Uint8Array ,
140
128
function : function isBigInt64Array ( value ) {
141
- return TypedArrayProto_toStringTag ( value ) === 'BigInt64Array' ;
129
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'BigInt64Array' ;
142
130
}
143
131
} ,
144
132
{
145
133
name : 'isBigUint64Array' ,
146
- supported : supported . Uint8Array ,
147
134
function : function isBigUint64Array ( value ) {
148
- return TypedArrayProto_toStringTag ( value ) === 'BigUint64Array' ;
135
+ return supported . Uint8Array && TypedArrayProto_toStringTag ( value ) === 'BigUint64Array' ;
149
136
}
150
137
} ,
151
138
{
@@ -252,16 +239,14 @@ var methods = [
252
239
} ,
253
240
{
254
241
name : 'isBigIntObject' ,
255
- supported : supported . BigInt ,
256
242
function : function isBigIntObject ( value ) {
257
- return checkBoxedPrimitive ( value , bigIntValue ) ;
243
+ return supported . BigInt && checkBoxedPrimitive ( value , bigIntValue ) ;
258
244
}
259
245
} ,
260
246
{
261
247
name : 'isSymbolObject' ,
262
- supported : supported . Symbol ,
263
248
function : function isSymbolObject ( value ) {
264
- return checkBoxedPrimitive ( value , symbolValue ) ;
249
+ return supported . Symbol && checkBoxedPrimitive ( value , symbolValue ) ;
265
250
}
266
251
} ,
267
252
{
@@ -271,41 +256,39 @@ var methods = [
271
256
exports . isNumberObject ( value ) ||
272
257
exports . isStringObject ( value ) ||
273
258
exports . isBooleanObject ( value ) ||
274
- ( supported . BigInt && exports . isBigIntObject ( value ) ) ||
275
- ( supported . Symbol && exports . isSymbolObject ( value ) )
259
+ exports . isBigIntObject ( value ) ||
260
+ exports . isSymbolObject ( value )
276
261
) ;
277
262
}
278
263
} ,
279
264
{
280
265
name : 'isAnyArrayBuffer' ,
281
- supported : supported . Uint8Array ,
282
266
function : function isAnyArrayBuffer ( value ) {
283
- return (
267
+ return supported . Uint8Array && (
284
268
exports . isArrayBuffer ( value ) ||
285
269
exports . isSharedArrayBuffer ( value )
286
270
) ;
287
271
}
288
272
} ,
289
273
{
290
274
name : 'isProxy' ,
291
- supported : false
275
+ disabled : true
292
276
} ,
293
277
{
294
278
name : 'isExternal' ,
295
- supported : false
279
+ disabled : true
296
280
} ,
297
281
{
298
282
name : 'isModuleNamespaceObject' ,
299
- supported : false
283
+ disabled : true
300
284
} ,
301
285
] ;
302
286
303
287
methods . forEach ( function ( method ) {
304
- const supported = method . supported !== false ;
305
288
Object . defineProperty ( exports , method . name , {
306
- enumerable : supported ,
307
- value : supported ? method . function : function ( ) {
308
- throw new Error ( method . name + ' is not supported' ) ;
289
+ enumerable : ! method . disabled ,
290
+ value : ! method . disabled ? method . function : function ( ) {
291
+ throw new Error ( method . name + ' is not supported in userland ' ) ;
309
292
}
310
293
} ) ;
311
294
} ) ;
0 commit comments