Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
1 year ago
|
'use strict';
|
||
|
var global = require('../internals/global');
|
||
|
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
|
||
|
var lengthOfArrayLike = require('../internals/length-of-array-like');
|
||
|
var toOffset = require('../internals/to-offset');
|
||
|
var toObject = require('../internals/to-object');
|
||
|
var fails = require('../internals/fails');
|
||
|
|
||
|
var RangeError = global.RangeError;
|
||
|
var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
||
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
||
|
|
||
|
var FORCED = fails(function () {
|
||
|
// eslint-disable-next-line es/no-typed-arrays -- required for testing
|
||
|
new Int8Array(1).set({});
|
||
|
});
|
||
|
|
||
|
// `%TypedArray%.prototype.set` method
|
||
|
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
|
||
|
exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
|
||
|
aTypedArray(this);
|
||
|
var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
|
||
|
var length = this.length;
|
||
|
var src = toObject(arrayLike);
|
||
|
var len = lengthOfArrayLike(src);
|
||
|
var index = 0;
|
||
|
if (len + offset > length) throw RangeError('Wrong length');
|
||
|
while (index < len) this[offset + index] = src[index++];
|
||
|
}, FORCED);
|