Search completed in 0.88 seconds.
103 results for "RangeError":
Your results are loading. Please wait...
RangeError - JavaScript
the rangeerror object indicates an error when a value is not in the set or range of allowed values.
... description a rangeerror is thrown when trying to pass a value as an argument to a function that does not allow a range that includes the value.
... constructor rangeerror() creates a new rangeerror object.
...And 8 more matches
RangeError() constructor - JavaScript
the rangeerror() constructor creates an error when a value is not in the set or range of allowed values.
... syntax new rangeerror([message[, filename[, linenumber]]]) parameters message optional human-readable description of the error.
... filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples using rangeerror (for numeric values) function check(n) { if( !(n >= -500 && n <= 500) ) { throw new rangeerror("the argument must be between -500 and 500.") } } try { check(2000) } catch(error) { if (error instanceof rangeerror) { // handle the error } } using rangeerror (for non-numeric values) function check(value) { if(["apple", "banana", "carrot"].includes(value) === false) { throw new rangeerror('the argument must be an "apple", "banana", or "carrot".') } } try { check("cabbage") } catch(error) { if(error instanceof rangeerror) { /...
RangeError: invalid date - JavaScript
message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong?
...however, depending on the implementation, non–conforming iso format strings, may also throw rangeerror: invalid date, like the following cases in firefox: new date('foo-bar 2014'); new date('2014-25-23').toisostring(); new date('foo-bar 2014').tostring(); this, however, returns nan in firefox: date.parse('foo-bar 2014'); // nan for more details, see the date.parse() documentation.
RangeError: repeat count must be non-negative - JavaScript
message rangeerror: argument out of range rangeerror: repeat count must be non-negative (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
... examples invalid cases 'abc'.repeat(-1); // rangeerror valid cases 'abc'.repeat(0); // '' 'abc'.repeat(1); // 'abc' 'abc'.repeat(2); // 'abcabc' 'abc'.repeat(3.5); // 'abcabcabc' (count will be converted to integer) ...
RangeError: argument is not a valid code point - JavaScript
message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong?
... examples invalid cases string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeerror string.fromcodepoint(3e-2); // rangeerror string.fromcodepoint(nan); // rangeerror valid cases string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodep...
RangeError: precision is out of range - JavaScript
message rangeerror: the number of fractional digits is out of range (edge) rangeerror: the precision is out of range (edge) rangeerror: precision {0} out of range (firefox) rangeerror: toexponential() argument must be between 0 and 20 (chrome) rangeerror: tofixed() digits argument must be between 0 and 20 (chrome) rangeerror: toprecision() argument must be between 1 and 21 (chrome) error type rangeerror what went wrong?
... method firefox (spidermonkey) chrome, opera (v8) number.prototype.toexponential() 0 to 100 0 to 20 number.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // rangeerror 77.1234.toexponential(101); // rangeerror 2.34.tofixed(-100); // rangeerror 2.34.tofixed(1001); // rangeerror 1234.5.toprecision(-1); // rangeerror 1234.5.toprecision(101); // rangeerror valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456...
RangeError: repeat count must be less than infinity - JavaScript
message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
... examples invalid cases 'abc'.repeat(infinity); // rangeerror 'a'.repeat(2**28); // rangeerror valid cases 'abc'.repeat(0); // '' 'abc'.repeat(1); // 'abc' 'abc'.repeat(2); // 'abcabc' 'abc'.repeat(3.5); // 'abcabcabc' (count will be converted to integer) ...
RangeError: radix must be an integer - JavaScript
message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong?
RangeError: invalid array length - JavaScript
message rangeerror: array length must be a finite positive integer (edge) rangeerror: invalid array length (firefox) rangeerror: invalid array length (chrome) rangeerror: invalid array buffer length (chrome) error type rangeerror what went wrong?
String.fromCodePoint() - JavaScript
exceptions a rangeerror is thrown if an invalid unicode code point is given (e.g.
... "rangeerror: nan is not a valid code point").
... index !== len; ++index) { var codepoint = +arguments[index]; // correctly handles all cases including `nan`, `-infinity`, `+infinity` // the surrounding `!(...)` is required to correctly handle `nan` cases // the (codepoint>>>0) === codepoint clause handles decimals and negatives if (!(codepoint < 0x10ffff && (codepoint>>>0) === codepoint)) throw rangeerror("invalid code point: " + codepoint); if (codepoint <= 0xffff) { // bmp code point codelen = codeunits.push(codepoint); } else { // astral code point; split in surrogate halves // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codepoint -= 0x10000; codelen = codeunits.push( (codepoint >> 10) + 0xd800, // hi...
... using fromcodepoint() valid input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" == "Є" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodepoint(0x1d306, 0x61, 0x1d307); // "\ud834\udf06a\ud834\udf07" invalid input: string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeerror string.fromcodepoint(3e-2); // rangeerror string.fromcodepoint(nan); // rangeerror compared to fromcharcode() string.fromcharcode() cannot return supplementary characters (i.e.
String.prototype.repeat() - JavaScript
exceptions rangeerror: repeat count must be non-negative.
... rangeerror: repeat count must be less than infinity and not overflow maximum string size.
... count = +count; // check nan if (count != count) count = 0; if (count < 0) throw new rangeerror('repeat count must be non-negative'); if (count == infinity) throw new rangeerror('repeat count must be less than infinity'); count = math.floor(count); if (str.length == 0 || count == 0) return ''; // ensuring count is a 31-bit integer allows us to heavily optimize the // main part.
... but anyway, most current (august 2014) browsers can't handle // strings 1 << 28 chars or longer, so: if (str.length * count >= 1 << 28) throw new rangeerror('repeat count must not overflow maximum string size'); var maxcount = str.length * count; count = math.floor(math.log(count) / math.log(2)); while (count) { str += str; count--; } str += str.substring(0, maxcount - str.length); return str; } } examples using repeat 'abc'.repeat(-1) // rangeerror 'abc'.repeat(0) // '' 'abc'.repeat(1) // 'abc' 'abc'.repeat(2) // 'abcabc' 'abc'.repeat(3.5) // 'abcabcabc' (count will be converted to integer) 'abc'.repeat(1/0) // rangeerror ({ tostring: () => 'abc', repeat: string.prototype.repeat }).repeat(2) // 'abcabc' (repeat() is a ge...
Object.prototype.watch() - Archive of obsolete content
class person { constructor(name, age) { this.watch('age', this._isvalidassignment.bind(this)); this.watch('name', this._isvalidassignment.bind(this)); this.name = name; this.age = age; } tostring() { return this.name + ', ' + this.age; } _isvalidassignment(id, oldval, newval) { if (id === 'name' && (!newval || newval.length > 30)) { throw new rangeerror('invalid name for ' + this); } if (id === 'age' && (newval < 0 || newval > 200)) { throw new rangeerror('invalid age for ' + this); } return newval; } } const will = new person('will', 29); console.log(will); // will, 29 try { will.name = ''; } catch (e) { console.log(e); } try { will.age = -4; } catch (e) { console.log(e); } this script displays the follow...
...ing: will, 29 rangeerror: invalid name for will, 29 rangeerror: invalid age for will, 29 specifications not part of any standard.
Bytecode Descriptions
this throws a rangeerror if both values are bigints and the exponent is negative.
...if index is int32_max, this throws a rangeerror.
PannerNode.refDistance - Web APIs
if the value is set to less than 0, a rangeerror is thrown.
... exceptions rangeerror the property has been given a value that is outside the accepted range.
Indexed collections - JavaScript
// // this is equivalent to: let arr = [] arr.length = 42 calling array(n) results in a rangeerror, if n is a non-whole number whose fractional portion is non-zero.
... let arr = array(9.3) // rangeerror: invalid array length if your code needs to create arrays with single elements of an arbitrary data type, it is safer to use array literals.
Error - JavaScript
rangeerror creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
...{ console.error(e.name + ': ' + e.message) } handling a specific error you can choose to handle only specific error types by testing the error type with the error's constructor property or, if you're writing for modern javascript engines, instanceof keyword: try { foo.bar() } catch (e) { if (e instanceof evalerror) { console.error(e.name + ': ' + e.message) } else if (e instanceof rangeerror) { console.error(e.name + ': ' + e.message) } // ...
Number.prototype.toExponential() - JavaScript
exceptions rangeerror if fractiondigits is too small or too large.
... values between 0 and 20, inclusive, will not cause a rangeerror.
Number.prototype.toFixed() - JavaScript
exceptions rangeerror if digits is too small or too large.
... values between 0 and 100, inclusive, will not cause a rangeerror.
try...catch - JavaScript
conditional catch-blocks you can create "conditional catch-blocks" by combining try...catch blocks with if...else if...else structures, like this: try { myroutine(); // may throw three types of exceptions } catch (e) { if (e instanceof typeerror) { // statements to handle typeerror exceptions } else if (e instanceof rangeerror) { // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any unspecified exceptions logmyerrors(e); // pass exception object to error handler } } a common use case for this is to only catch (and silence) a small subset of expected errors, and then re-throw the error i...
...n other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very common expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value.
StringView - Archive of obsolete content
infinity : nchrlength; if (nchrlength + 1 > atarget.length) { throw new rangeerror("stringview.prototype.makeindex - the offset can\'t be major than the length of the array - 1."); } switch (this.encoding) { case "utf-8": var npart; for (nchrend = 0; nidxend < nrawlength && nchrend < nstopatchr; nchrend++) { npart = atarget[nidxend]; nidxend += npart > 251 && npart < 254 && nidxend + 5 < nrawlength ?
PromiseWorker.jsm
supported built-in javascript error are following: evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror in addition to them, stopiteration is also supported (note that stopiteration is deprecated).
Self-hosted builtins in SpiderMonkey
throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized.
JSExnType
(lower bound) jsexn_err error jsexn_internalerr internalerror jsexn_evalerr evalerror jsexn_rangeerr rangeerror jsexn_referenceerr referenceerror jsexn_syntaxerr syntaxerror jsexn_typeerr typeerror jsexn_urierr urierror jsexn_limit (upper bound) description these types are part of a jserrorformatstring structure.
JSProtoKey
oto_number jsproto_string string mxr search for jsproto_string jsproto_regexp regexp mxr search for jsproto_regexp jsproto_error error mxr search for jsproto_error jsproto_internalerror internalerror mxr search for jsproto_internalerror jsproto_evalerror evalerror mxr search for jsproto_evalerror jsproto_rangeerror rangeerror mxr search for jsproto_rangeerror jsproto_referenceerror referenceerror mxr search for jsproto_referenceerror jsproto_syntaxerror syntaxerror mxr search for jsproto_syntaxerror jsproto_typeerror typeerror mxr search for jsproto_typeerror jsproto_urierror urierror mxr search for jsproto_urierror jsproto...
JS_InitStandardClasses
these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolean, date, decodeuri, decodeuricomponent, encodeuri, encodeuricomponent, error, eval, evalerror, function, infinity, isnan, isfinite, math, nan, number, object, parseint, parsefloat, rangeerror, referenceerror, regexp, string, syntaxerror, typeerror, undefined, and urierror as well as a few spidermonkey-specific globals, depending on compile-time options: escape, unescape, uneval, internalerror, script, xml, namespace, qname, file, generator, iterator, and stopiteration, as of spidermonkey 1.7.
ArrayType
exceptions thrown typeerror type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number.
StructType
rangeerror the size of the structure, in bytes, cannot be represented both as a size_t and as a javascript number.
AudioBuffer() - Web APIs
rangeerror there isn't enough memory available to allocate the buffer.
AudioParam.setValueCurveAtTime() - Web APIs
rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number.
AudioScheduledSourceNode.start() - Web APIs
rangeerror the value specified for when is negative.
AudioScheduledSourceNode.stop() - Web APIs
rangeerror the value specified for when is negative.
BaseAudioContext.createBuffer() - Web APIs
rangeerror there isn't enough memory available to allocate the buffer.
Index - Web APIs
WebAPIIndex
if the value is set to less than 0, a rangeerror is thrown.
IntersectionObserver.IntersectionObserver() - Web APIs
rangeerror one or more of the values in threshold is outside the range 0.0 to 1.0.
MerchantValidationEvent() - Web APIs
rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier.
PannerNode.PannerNode() - Web APIs
exceptions rangeerror the refdistance, maxdistance, or rollofffactor properties have been given a value that is outside the accepted range.
PannerNode.maxDistance - Web APIs
exceptions rangeerror the property has been given a value that is outside the accepted range.
PannerNode.rolloffFactor - Web APIs
exceptions rangeerror the property has been given a value that is outside the accepted range.
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
therefore, specifying a value less than 1.0 is not permitted and will cause a rangeerror exception to be thrown by rtcpeerconnection.addtransceiver() or rtcrtpsender.setparameters().
RTCRtpSender.setParameters() - Web APIs
rangeerror the value specified for scaleresolutiondownby is less than 1.0, which would result in scaling up rather than down, which is not allowed; or one or more of the specified encodings' maxframerate values is less than 0.0.
ReadableStream.ReadableStream() - Web APIs
exceptions rangeerror the supplied type value is neither "bytes" nor undefined.
ReadableStream.getReader() - Web APIs
exceptions rangeerror the provided mode value is not "byob" or undefined.
Response.redirect() - Web APIs
WebAPIResponseredirect
exceptions exception explanation rangeerror the specified status is not a redirect status.
InternalError: too much recursion - JavaScript
message error: out of stack space (edge) internalerror: too much recursion (firefox) rangeerror: maximum call stack size exceeded (chrome) error type internalerror.
JavaScript error reference - JavaScript
error: permission denied to access property "x"internalerror: too much recursionrangeerror: argument is not a valid code pointrangeerror: invalid array lengthrangeerror: invalid daterangeerror: precision is out of rangerangeerror: radix must be an integerrangeerror: repeat count must be less than infinityrangeerror: repeat count must be non-negativereferenceerror: "x" is not definedreferenceerror: assignment to undeclared variable "x"referenceerror: can't access lexical declaration "x"...
Array() constructor - JavaScript
if the argument is any other number, a rangeerror exception is thrown.
Array.prototype.length - JavaScript
var namelista = new array(4294967296); //2 to the 32nd power = 4294967296 var namelistc = new array(-100) //negative sign console.log(namelista.length); //rangeerror: invalid array length console.log(namelistc.length); //rangeerror: invalid array length var namelistb = []; namelistb.length = math.pow(2,32)-1; //set array length less than 2 to the 32nd power console.log(namelistb.length); //4294967295 you can set the length property to truncate an array at any time.
ArrayBuffer() constructor - JavaScript
exceptions a rangeerror is thrown if the length is larger than number.max_safe_integer (>= 2 ** 53) or negative.
Atomics.add() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.and() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.compareExchange() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.exchange() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.load() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.notify() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.or() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.store() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.sub() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.wait() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
Atomics.xor() - JavaScript
throws a rangeerror, if index is out of bounds in the typedarray.
BigInt.prototype.toString() - JavaScript
exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown.
DataView() constructor - JavaScript
exceptions rangeerror thrown if the byteoffset or bytelength parameter values result in the view extending past the end of the buffer.
DataView.prototype.getBigInt64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
DataView.prototype.getBigUint64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
DataView.prototype.getFloat32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getFloat64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getInt16() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getInt32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getInt8() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getUint16() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getUint32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.getUint8() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
DataView.prototype.setBigInt64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view.
DataView.prototype.setBigUint64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view.
DataView.prototype.setFloat32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setFloat64() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setInt16() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setInt32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setInt8() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setUint16() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setUint32() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
DataView.prototype.setUint8() - JavaScript
errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view.
Date.parse() - JavaScript
however, if the string is recognized as an iso format string and it contains invalid values, it will return nan in all browsers compliant with es5 and later: // iso string with invalid values new date('2014-25-23').toisostring(); // throws "rangeerror: invalid date" in all es5-compliant browsers spidermonkey's implementation-specific heuristic can be found in jsdate.cpp.
Date.prototype.toLocaleDateString() - JavaScript
to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocaledatestringsupportslocales() { try { new date().tolocaledatestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } using locales this example shows some of the variations in localized date formats.
Date.prototype.toLocaleString() - JavaScript
to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocalestringsupportslocales() { try { new date().tolocalestring('i'); } catch (e) { return e instanceof rangeerror; } return false; } using locales this example shows some of the variations in localized date and time formats.
Date.prototype.toLocaleTimeString() - JavaScript
to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocaletimestringsupportslocales() { try { new date().tolocaletimestring('i'); } catch (e) { return e​.name === 'rangeerror'; } return false; } using locales this example shows some of the variations in localized time formats.
Intl.getCanonicalLocales() - JavaScript
examples using getcanonicallocales intl.getcanonicallocales('en-us'); // ["en-us"] intl.getcanonicallocales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonicallocales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.getcanonicallocales' in that specification.
Number.prototype.toLocaleString() - JavaScript
to check for support in es5.1 and later implementations, the requirement that illegal language tags are rejected with a rangeerror exception can be used: function tolocalestringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments.
Number.prototype.toPrecision() - JavaScript
exceptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown.
Number.prototype.toString() - JavaScript
exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown.
Proxy - JavaScript
let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new typeerror('the age is not an integer'); } if (value > 200) { throw new rangeerror('the age seems invalid'); } } // the default behavior to store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could ea...
String.prototype.localeCompare() - JavaScript
to check whether an implementation supports them, use the "i" argument (a requirement that illegal language tags are rejected) and look for a rangeerror exception: function localecomparesupportslocales() { try { 'foo'.localecompare('bar', 'i'); } catch (e) { return e.name === 'rangeerror'; } return false; } using locales the results provided by localecompare() vary between languages.
String.prototype.normalize() - JavaScript
errors thrown rangeerror a rangeerror is thrown if form isn't one of the values specified above.
String.prototype.toLocaleLowerCase() - JavaScript
exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag.
String.prototype.toLocaleUpperCase() - JavaScript
exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag.
TypedArray.prototype.set() - JavaScript
exceptions a rangeerror, if the offset is set such as it would store beyond the end of the typed array.
WebAssembly.Memory() constructor - JavaScript
if maximum is specified and is smaller than initial, a rangeerror is thrown.
WebAssembly.Table() constructor - JavaScript
if maximum is specified and is smaller than initial, a rangeerror is thrown.
WebAssembly.Table.prototype.get() - JavaScript
exceptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown.
WebAssembly.Table.prototype.grow() - JavaScript
exceptions if the grow() operation fails for whatever reason, a rangeerror is thrown.
WebAssembly.Table.prototype.set() - JavaScript
exceptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown.
Standard built-in objects - JavaScript
error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers and dates these are the base objects representing numbers, dates, and mathematical calculations.
JavaScript reference - JavaScript
value properties infinity nan undefined globalthis function properties eval() isfinite() isnan() parsefloat() parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset ...
Using the WebAssembly JavaScript API - WebAssembly
growing memory a memory instance can be grown by calls to memory.prototype.grow(), where again the argument is specified in units of webassembly pages: memory.grow(1); if a maximum value was supplied upon creation of the memory instance, attempts to grow past this maximum will throw a webassembly.rangeerror exception.