@@ -963,38 +963,6 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
963
963
return acc ;
964
964
} ) ;
965
965
966
- /**
967
- * Returns a new typed array containing the elements in reversed order.
968
- *
969
- * @private
970
- * @name toReversed
971
- * @memberof TypedArray.prototype
972
- * @type {Function }
973
- * @throws {TypeError } `this` is not a typed array
974
- * @returns {TypedArray } reversed array
975
- */
976
- setReadOnly ( TypedArray . prototype , 'toReversed' , function toReversed ( ) {
977
- var obuf ;
978
- var out ;
979
- var len ;
980
- var buf ;
981
- var i ;
982
- var v ;
983
-
984
- if ( ! isTypedArray ( this ) ) {
985
- throw new TypeError ( 'invalid invocation. `this` is not a typed array.' ) ;
986
- }
987
- len = this . _length ;
988
- out = new this . constructor ( flag2byteOrder ( this . _isLE ) , len ) ;
989
- buf = this . _buffer ;
990
- obuf = out . _buffer ; // eslint-disable-line no-underscore-dangle
991
- for ( i = 0 ; i < len ; i ++ ) {
992
- v = buf [ GETTER ] ( ( len - i - 1 ) * BYTES_PER_ELEMENT , this . _isLE ) ;
993
- obuf [ SETTER ] ( i * BYTES_PER_ELEMENT , v , this . _isLE ) ;
994
- }
995
- return out ;
996
- } ) ;
997
-
998
966
/**
999
967
* Sets an array element.
1000
968
*
@@ -1121,6 +1089,38 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
1121
1089
return false ;
1122
1090
} ) ;
1123
1091
1092
+ /**
1093
+ * Returns a new typed array containing the elements in reversed order.
1094
+ *
1095
+ * @private
1096
+ * @name toReversed
1097
+ * @memberof TypedArray.prototype
1098
+ * @type {Function }
1099
+ * @throws {TypeError } `this` is not a typed array
1100
+ * @returns {TypedArray } reversed array
1101
+ */
1102
+ setReadOnly ( TypedArray . prototype , 'toReversed' , function toReversed ( ) {
1103
+ var obuf ;
1104
+ var out ;
1105
+ var len ;
1106
+ var buf ;
1107
+ var i ;
1108
+ var v ;
1109
+
1110
+ if ( ! isTypedArray ( this ) ) {
1111
+ throw new TypeError ( 'invalid invocation. `this` is not a typed array.' ) ;
1112
+ }
1113
+ len = this . _length ;
1114
+ out = new this . constructor ( flag2byteOrder ( this . _isLE ) , len ) ;
1115
+ buf = this . _buffer ;
1116
+ obuf = out . _buffer ; // eslint-disable-line no-underscore-dangle
1117
+ for ( i = 0 ; i < len ; i ++ ) {
1118
+ v = buf [ GETTER ] ( ( len - i - 1 ) * BYTES_PER_ELEMENT , this . _isLE ) ;
1119
+ obuf [ SETTER ] ( i * BYTES_PER_ELEMENT , v , this . _isLE ) ;
1120
+ }
1121
+ return out ;
1122
+ } ) ;
1123
+
1124
1124
/**
1125
1125
* Serializes an array as a string.
1126
1126
*
0 commit comments