@@ -67,13 +67,12 @@ var DTYPE2GET = {
67
67
'uint32' : 'getUint32' ,
68
68
'uint16' : 'getUint16'
69
69
} ;
70
- var DTYPE2ARTICLE = {
71
- 'float64' : 'a' ,
72
- 'float32' : 'a' ,
73
- 'int32' : 'an' ,
74
- 'int16' : 'an' ,
75
- 'uint32' : 'a' ,
76
- 'uint16' : 'a'
70
+ var CHAR2ARTICLE = {
71
+ 'c' : 'a' ,
72
+ 'f' : 'a' ,
73
+ 'i' : 'an' ,
74
+ 'u' : 'a' ,
75
+ 'b' : 'a'
77
76
} ;
78
77
var isDataType = contains ( DTYPES ) ;
79
78
@@ -367,7 +366,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
367
366
throw new TypeError ( 'invalid invocation. `this` context must be a constructor.' ) ;
368
367
}
369
368
if ( ! isTypedArrayConstructor ( this ) ) {
370
- throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , DTYPE2ARTICLE [ dtype ] , CTOR_NAME ) ) ;
369
+ throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , CHAR2ARTICLE [ dtype [ 0 ] ] , CTOR_NAME ) ) ;
371
370
}
372
371
order = byteOrder ( endianness ) ;
373
372
if ( order === null || ! isByteOrder ( order ) ) {
@@ -445,7 +444,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
445
444
throw new TypeError ( 'invalid invocation. `this` context must be a constructor.' ) ;
446
445
}
447
446
if ( ! isTypedArrayConstructor ( this ) ) {
448
- throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , DTYPE2ARTICLE [ dtype ] , CTOR_NAME ) ) ;
447
+ throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , CHAR2ARTICLE [ dtype [ 0 ] ] , CTOR_NAME ) ) ;
449
448
}
450
449
order = byteOrder ( endianness ) ;
451
450
if ( order === null || ! isByteOrder ( order ) ) {
@@ -522,7 +521,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
522
521
*/
523
522
setReadOnly ( TypedArray . prototype , 'get' , function get ( idx ) {
524
523
if ( ! isTypedArray ( this ) ) {
525
- throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , DTYPE2ARTICLE [ dtype ] , CTOR_NAME ) ) ;
524
+ throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , CHAR2ARTICLE [ dtype [ 0 ] ] , CTOR_NAME ) ) ;
526
525
}
527
526
if ( ! isNonNegativeInteger ( idx ) ) {
528
527
throw new TypeError ( format ( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.' , idx ) ) ;
@@ -591,7 +590,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
591
590
var i ;
592
591
var j ;
593
592
if ( ! isTypedArray ( this ) ) {
594
- throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , DTYPE2ARTICLE [ dtype ] , CTOR_NAME ) ) ;
593
+ throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , CHAR2ARTICLE [ dtype [ 0 ] ] , CTOR_NAME ) ) ;
595
594
}
596
595
buf = this . _buffer ;
597
596
if ( arguments . length > 1 ) {
@@ -656,7 +655,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
656
655
var buf ;
657
656
var i ;
658
657
if ( ! isTypedArray ( this ) ) {
659
- throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , DTYPE2ARTICLE [ dtype ] , CTOR_NAME ) ) ;
658
+ throw new TypeError ( format ( 'invalid invocation. `this` is not %s %s.' , CHAR2ARTICLE [ dtype [ 0 ] ] , CTOR_NAME ) ) ;
660
659
}
661
660
out = [ ] ;
662
661
buf = this . _buffer ;
0 commit comments