Search completed in 3.25 seconds.
The arguments object - JavaScript
arguments is an array-like object accessible inside functions that contains the values of the
arguments passed to that function.
... note: “array-like” means that
arguments has a length property and properties indexed from zero, but it doesn't have array's built-in methods like foreach() or map().
... the
arguments object is a local variable available within all non-arrow functions.
...And 18 more matches
JS_ConvertArguments
syntax bool js_convert
arguments(jscontext *cx, const js::callargs &args, const char *format, ...); // added in spidermonkey 31 bool js_convert
arguments(jscontext *cx, unsigned argc, jsval *argv, const char *format, ...); // obsolete since jsapi 30 name type description cx jscontext * the context in which to perform any necessary conversions.
... args const js::callargs & reference to the
arguments to convert.
... added in spidermonkey 31 argc unsigned the number of
arguments to convert.
...And 13 more matches
JS_PushArguments
convert any number of
arguments to jsvals and store the resulting jsvals in an array.
... syntax jsval * js_push
arguments(jscontext *cx, void **markp, const char *format, ...); jsval * js_push
argumentsva(jscontext *cx, void **markp, const char *format, va_list ap); name type description cx jscontext * the context in which to perform any necessary conversions.
...on success, *markp receives the internally allocated stack mark which should be passed to js_pop
arguments.
...And 12 more matches
arguments.callee - JavaScript
the
arguments.callee property contains the currently executing function.
... description callee is a property of the
arguments object.
... warning: the 5th edition of ecmascript (es5) forbids use of
arguments.callee() in strict mode.
...And 10 more matches
JS_ConvertArgumentsVA
syntax bool js_convert
argumentsva(jscontext *cx, const js::callargs &args, const char *format, va_list ap); bool js_convert
argumentsva(jscontext *cx, unsigned argc, jsval *argv, const char *format, va_list ap); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... args const js::callargs & reference to the
arguments to convert.
... added in spidermonkey 31 argc unsigned the number of
arguments to convert.
...And 5 more matches
Function.arguments - JavaScript
the function.
arguments property refers to an an array-like object corresponding to the
arguments passed to a function.
... use the simple variable
arguments instead.
... description the syntax function.
arguments is deprecated.
...And 5 more matches
ReferenceError: deprecated caller or arguments usage - JavaScript
the javascript strict mode-only exception "deprecated caller or
arguments usage" occurs when the deprecated function.caller or function.
arguments properties are used.
... message typeerror: '
arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (edge) warning: referenceerror: deprecated caller usage (firefox) warning: referenceerror: deprecated
arguments usage (firefox) typeerror: 'callee' and 'caller' cannot be accessed in strict mode.
... in strict mode, the function.caller or function.
arguments properties are used and shouldn't be.
...And 3 more matches
JS_PopArguments
frees the stack entry allocated by js_push
arguments.
... syntax void js_pop
arguments(jscontext *cx, void *mark); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... mark void * pointer to a void * which holds the stack frame pointer previously supplied by js_push
arguments.
...And 2 more matches
TypeError: More arguments needed - JavaScript
the javascript exception "more
arguments needed" occurs when there is an error with how a function is called.
... more
arguments need to be provided.
... message typeerror: argument is not an object and is not null (edge) typeerror: object.create requires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof requires at least 2
arguments, but only 0 were passed typeerror: object.defineproperties requires at least 1 argument, but only 0 were passed error type typeerror.
...And 2 more matches
TypeError: invalid arguments - JavaScript
the javascript exception "invalid
arguments" occurs when typed array constructors are provided with a wrong argument.
... message typeerror: invalid
arguments (firefox) error type typeerror what went wrong?
...other constructor
arguments will not create a valid typed array.
... var ta = new uint8array("nope"); // typeerror: invalid
arguments different ways to create a valid uint8array: // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var...
arguments.length - JavaScript
the
arguments.length property contains the number of
arguments passed to the function.
... description the
arguments.length property provides the number of
arguments actually passed to a function.
... examples using
arguments.length in this example we define a function that can add two or more numbers together.
...*/) { base = number(base); for (var i = 1; i <
arguments.length; i++) { base += number(
arguments[i]); } return base; } note the difference between function.length and
arguments.length specifications specification ecmascript (ecma-262)the definition of '
arguments exotic objects' in that specification.
arguments.caller - Archive of obsolete content
the obsolete
arguments.caller property used to provide the function that invoked the currently executing function.
... function whocalled() { if (whocalled.caller == null) console.log('i was called from the global scope.'); else console.log(whocalled.caller + ' called me!'); } examples the following code was used to check the value of
arguments.caller in a function, but doesn't work anymore.
... function whocalled() { if (
arguments.caller == null) console.log('i was called from the global scope.'); else console.log(
arguments.caller + ' called me!'); } specifications not part of any standard.
Window.dialogArguments - Web APIs
the dialog
arguments property returns the parameters that were passed into the window.showmodaldialog() method.
... syntax value = window.dialog
arguments; ...
arguments[@@iterator]() - JavaScript
syntax
arguments[symbol.iterator]() examples iteration using for...of loop function f() { // your browser must support for..of loop // and let-scoped variables in for loops for (let letter of
arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p'); specifications specification ecmascript (ecma-262)the definition of 'createunmapped
argumentsobject' in that specification.
... ecmascript (ecma-262)the definition of 'createmapped
argumentsobject' in that specification.
WebIDL bindings
add external interface entries to bindings.conf for whatever non-webidl interfaces your new interface has as
arguments or return values.
... the method signature for the getter looks just like an operation with no
arguments and the attribute's type as the return type.
...the
arguments of this method will be the
arguments of the webidl constructor, with a const globalobject& for the relevant global prepended.
...And 45 more matches
Index
synopsis cmsutil [options]
arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
... to run cmsutil, type the command cmsutil option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
...And 42 more matches
jspage - Archive of obsolete content
{var o=this.prototype[n];if((n=o)){return j(this,l,n,p); }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); }return this;};if(c){d.implement(c);}return d;};native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=array.prototype.slice.call(
arguments); return b.prototype[c].apply(d.shift(),d);};}};native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boo...
... b;},getlength:function(){var b=0;for(var a in this){if(this.hasownproperty(a)){b++; }}return b;}});hash.alias("foreach","each");array.implement({foreach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});array.alias("foreach","each"); function $a(b){if(b.item){var a=b.length,c=new array(a);while(a--){c[a]=b[a];}return c;}return array.prototype.slice.call(b);}function $
arguments(a){return function(){return
arguments[a]; };}function $chk(a){return !!(a||a===0);}function $clear(a){cleartimeout(a);clearinterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); ((a=="
arguments"||a=="collection"||a=="array")?array:hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; }function $h(a...
...){return new hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=array.slice(
arguments); a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=
arguments.length;d<a;d++){var b=
arguments[d];if($type(b)!="object"){continue; }for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=
arguments.length; b<a;b++){if(
arguments[b]!=undefined){return
arguments[b];}}return null;}function $random(b,a){return math.floor(math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); return(a)?((a!="array"&&a!="
arguments")?[b]:b):[];}var $time=date.now||function(){return +new date;};function $try(){for(var b=0,a=
arguments.length;b<a; b++){try{return a...
...And 31 more matches
StringView - Archive of obsolete content
arguments input (required) the argument the stringview is constructed from.
... object reference to stringview.bufferview or a new arraybufferview of stringview.buffer will be created (depending on startoffset and length
arguments passed).
... object reference to stringview.bufferview or a new arraybufferview of stringview.buffer will be created (depending on startoffset and length
arguments passed).
...And 21 more matches
Functions - JavaScript
console.log(square(5)) // uncaught typeerror: square is not a function const square = function(n) { return n * n; } the
arguments of a function are not limited to strings and numbers.
...there are often cases where a function needs to be called dynamically, or the number of
arguments to a function vary, or in which the context of the function call needs to be set to a specific object determined at runtime.
...there are three ways for a function to refer to itself: the function's name
arguments.callee an in-scope variable that refers to the function for example, consider the following function definition: var foo = function bar() { // statements go here } within the function body, the following are all equivalent: bar()
arguments.callee() foo() a function that calls itself is called a recursive function.
...And 21 more matches
JIT Optimization Strategies
getproperty getproperty_
argumentslength attempts to optimize an
arguments.length property access.
... this optimization only works if the
arguments object is used in well-understood ways within the function.
... the function containing the
arguments.length is allowed to use the
arguments object in the following ways without disabling this optimization: access
arguments.length access
arguments.callee access individual args using
arguments[i] save
arguments into variables, as long as those variables cannot be accessed by any nested function, and as long as there exists no eval anywhere within the function or nested function definitions.
...And 20 more matches
OS.File for the main thread
promise<file> open( in string path, [optional] in object mode, [optional] in object options )
arguments path the full native name of the file to open.
... promise<object> openunique( in string path, [optional] in object options ) throws os.file.error
arguments path the full native name of the file to open.
... void copy( in string sourcepath, in string destpath [optional] in object options) throws os.file.error
arguments sourcepath the full path of the file to copy.
...And 18 more matches
Strict mode - JavaScript
changes generally fall into these categories: changes converting mistakes into errors (as syntax errors or at runtime), changes simplifying how the particular variable for a given use of a name is computed, changes simplifying eval and
arguments, changes making it easier to write "secure" javascript, and changes anticipating future ecmascript evolution.
...in normal code the last duplicated argument hides previous identically-named
arguments.
... those previous
arguments remain available through
arguments[i], so they're not completely inaccessible.
...And 18 more matches
Function.prototype.bind() - JavaScript
the bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of
arguments preceding any provided when the new function is called.
...if no
arguments are provided to bind , or if the thisarg is null or undefined, the this of the executing scope is treated as the thisarg for the new function.
... arg1, arg2, ...argn optional
arguments to prepend to
arguments provided to the bound function when invoking func.
...And 17 more matches
JavaScript Daemons Management - Archive of obsolete content
about the “callback
arguments” polyfill in order to make this framework compatible with internet explorer (which doesn't support sending additional parameters to timers' callback function, neither with settimeout() or setinterval()) we included the ie-specific compatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the...
...|*| http://www.gnu.org/licenses/gpl-3.0.html |*| \*/ "use strict"; /**************************** * the daemon system * ****************************/ /* the global "daemon" constructor */ function daemon (oowner, ftask, nrate, nlen, finit, fonstart) { if (!(this && this instanceof daemon)) { return; } if (
arguments.length < 2) { throw new typeerror("daemon - not enough
arguments"); } if (oowner) { this.owner = oowner }; this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } if (fonstart) { this.onstart = fonstart; } if (finit) { this.onstop = finit; finit.call(oowner, this.index, this.lengt...
... * *******************************/ /******************************* * polyfills * *******************************/ /*\ |*| |*| ie-specific polyfill which enables the passage of arbitrary
arguments to the |*| callback functions of javascript timers (html5 standard syntax).
...And 16 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
the function is not passed any
arguments, and no return value is expected.
... arg1, ..., argn optional additional
arguments which are passed through to the function specified by func once the timer expires.
... note: passing additional
arguments to setinterval() in the first syntax does not work in internet explorer 9 and earlier.
...And 16 more matches
Function.prototype.apply() - JavaScript
the apply() method calls a function with a given this value, and
arguments provided as an array (or an array-like object).
... argsarray optional an array-like object, specifying the
arguments with which func should be called, or null or undefined if no
arguments should be provided to the function.
... starting with ecmascript 5 these
arguments can be a generic array-like object instead of an array.
...And 16 more matches
Bytecode Descriptions
the
arguments are converted to integers first.
...format: jof_argc, jof_invoke, jof_typeset, jof_ic spreadcall stack: callee, this, args ⇒ rval like jsop::call, but the
arguments are provided in an array rather than a span of stack slots.
...args must be an array object containing the actual
arguments.
...And 15 more matches
NSS tools : certutil
name certutil — manage keys and certificate in both nss databases and other nss tokens synopsis certutil [options] [[
arguments]] description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key databases.
... options and
arguments running certutil always requires one and only one command option to specify the type of certificate operation.
... each option may take
arguments, anywhere from none to multiple
arguments.
...And 12 more matches
certutil
synopsis certutil [options]
arguments description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key database files.
... options and
arguments running certutil always requires one (and only one) option to specify the type of certificate operation.
... each option may take
arguments, anywhere from none to multiple
arguments.
...And 12 more matches
Using the CSS Painting API - Web APIs
a paint() function can take three
arguments.
... registerpaint('csspaintfunctionname', class { static get inputproperties() { return ['propertyname1', '--custompropertyname2']; } static get input
arguments() { return ['<color>']; } static get contextoptions() { return {alpha: true}; } paint(drawingcontext, elementsize, stylemap) { // paint code goes here.
...we'll take a look at input
arguments in the last section.
...And 11 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
arg1, ..., argn optional additional
arguments which are passed through to the function specified by function.
... polyfill if you need to pass one or more
arguments to your callback function, but need it to work in browsers which don't support sending additional
arguments using either settimeout() or setinterval() (e.g., internet explorer 9 and below), you can include this polyfill to enable the html5 standard
arguments-passing functionality.
... just add this code to the top of your script: /*\ |*| |*| polyfill which enables the passage of arbitrary
arguments to the |*| callback functions of javascript timers (html5 standard syntax).
...And 11 more matches
Shell global objects
variables scriptargs an array that contains
arguments passed to js shell.
... load(['foo.js' ...]) load files named by string
arguments.
... loadrelativetoscript(['foo.js' ...]) load files named by string
arguments.
...And 10 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
add(); // nan // you can't perform addition on undefined you can also pass in more
arguments than the function is expecting: add(2, 3, 4); // 5 // added the first two; 4 was ignored that may seem a little silly, but functions have access to an additional variable inside their body called
arguments, which is an array-like object holding all of the values passed to the function.
... let's re-write the add function to take as many values as we want: function add() { var sum = 0; for (var i = 0, j =
arguments.length; i < j; i++) { sum +=
arguments[i]; } return sum; } add(2, 3, 4, 5); // 14 that's really not any more useful than writing 2 + 3 + 4 + 5 though.
... let's create an averaging function: function avg() { var sum = 0; for (var i = 0, j =
arguments.length; i < j; i++) { sum +=
arguments[i]; } return sum /
arguments.length; } avg(2, 3, 4, 5); // 3.5 this is pretty useful, but it does seem a little verbose.
...And 10 more matches
tabs - Archive of obsolete content
if you need to access these properties, listen for the ready event: var tabs = require("sdk/tabs"); tabs.on('open', function(tab){ tab.on('ready', function(tab){ console.log(tab.url); }); });
arguments tab : listeners are passed the tab object that just opened.
...
arguments tab : listeners are passed the tab object that has closed.
...
arguments tab : listeners are passed the tab object that has loaded.
...And 8 more matches
Following the Android Toasts Tutorial from a JNI Perspective
the
arguments are within the parenthesis, and the return type is immediately following.
...for example, in our case we have a method maketext and show, looking that up on the android documentation page shows this: there are two columns, the first column is the return, and the second column is the method name and
arguments.
...the reason is that methods accept
arguments and return something.
...And 8 more matches
NSS Tools modutil
syntax to run the security module database tool, type the command modutil option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
... options and
arguments options specify an action.
...And 8 more matches
lang/functional - Archive of obsolete content
let { invoke } = require("sdk/lang/functional"); invoke(sum, [1,2,3,4,5], null); // 15 function sum () { return array.slice(
arguments).reduce(function (a, b) { return a + b; }); } parameters callee : function function to invoke.
... partial(fn,
arguments...) takes a function and bind values to one or more
arguments, returning a new function of smaller arity.
...
arguments...
...And 7 more matches
NSS Tools certutil
syntax to run the certificate database tool, type the command certutil option [
arguments ] where options and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
... options and
arguments options specify an action and are uppercase.
...And 7 more matches
Rhino shell
invoking the shell java org.mozilla.javascript.tools.shell.main [options] script-filename-or-url [script-
arguments] where options are: -e script-source executes script-source as a javascript script.
...
arguments the
arguments object is an array containing the strings of all the
arguments given at the command line when the shell was invoked.
... load([filename, ...]) load javascript source files named by string
arguments.
...And 7 more matches
JSAPI User Guide
js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return status; } each jsnative has the same signature, regardless of what
arguments it expects to receive from javascript.
... the javascript
arguments to the function are given in argc and vp.
... argc tells how many actual
arguments the caller passed, and js_argv(cx, vp) returns an array of those
arguments.
...And 7 more matches
Using Web Workers - Web APIs
then we can pass in the
arguments that the method needs.
... */ this.sendquery = function() { if (
arguments.length < 1) { throw new typeerror('queryableworker.sendquery takes at least one argument'); return; } worker.postmessage({ 'querymethod':
arguments[0], 'query
arguments': array.prototype.slice.call(
arguments, 1) }); } we finish queryableworker with the onmessage method.
... if the worker has the corresponding methods we queried, it should return the name of the corresponding listener and the
arguments it needs, we just need to find it in listeners.: worker.onmessage = function(event) { if (event.data instanceof object && event.data.hasownproperty('querymethodlistener') && event.data.hasownproperty('querymethod
arguments')) { listeners[event.data.querymethodlistener].apply(instance, event.data.querymethod
arguments); } else { this.defaultlistener.call(instance, event.data); } } now onto the worker.
...And 7 more matches
Rest parameters - JavaScript
the rest parameter syntax allows us to represent an indefinite number of
arguments as an array.
...which will cause all remaining (user supplied)
arguments to be placed within a "standard" javascript array.
... function myfun(a, b, ...manymoreargs) { console.log("a", a) console.log("b", b) console.log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // console output: // a, one // b, two // manymoreargs, [three, four, five, six] difference between rest parameters and the
arguments object there are three main differences between rest parameters and the
arguments object: rest parameters are only the ones that haven't been given a separate name (i.e.
...And 7 more matches
Functions - JavaScript
the parameters of a function call are the function's
arguments.
...
arguments are passed to functions by value.
...zero
arguments need to be indicated with ().
...And 7 more matches
cfx - Archive of obsolete content
supported options you can point cfx run at a different package.json file using the --pkgdir option, and pass
arguments to your add-on using the --static-args option.
... --binary-args=cmdargs pass extra
arguments to the binary being executed (for example, firefox).
... for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple
arguments, or
arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' --extra-packages=extra_packages extra packages to include, specified as a comma-separated list of package names.
...And 6 more matches
NSS tools : crlutil
synopsis crlutil [options] [[
arguments]] status this documentation is still work in progress.
... to run the certificate revocation list management tool, type the command crlutil option [
arguments] where options and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
...And 6 more matches
NSS tools : crlutil
synopsis crlutil [options]
arguments description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl.
... to run the certificate revocation list management tool, type the command crlutil option [
arguments] where options and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
...And 6 more matches
Components.utils.exportFunction
to understand what happens if the functions you export accept
arguments, see exporting functions that take
arguments below.
...this option allows the exported function to accept callbacks as
arguments.
...from firefox 34 onwards this option has no effect: the exported function is always able to accept callbacks as
arguments.
...And 6 more matches
nsIProcess
args an array of count
arguments, using the native character set, to be passed to the executable on its command line.
... count the number of
arguments in the args array.
... void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of
arguments to pass into the process, using the native character set.
...And 6 more matches
Declaring and Using Callbacks
c functions occasionally take function pointers as
arguments, which are generally used as callbacks.
...the first argument is the calling convention, the second argument is the return type, and the third is an array of
arguments the callback expects.
... examples example 1 this callback that returns bool and has two
arguments.
...And 6 more matches
Index - Web APIs
598 canvasrenderingcontext2d.settransform() api, canvas, canvasrenderingcontext2d, method, reference the canvasrenderingcontext2d.settransform() method of the canvas 2d api resets (overrides) the current transformation to the identity matrix, and then invokes a transformation described by the
arguments of this method.
... 609 canvasrenderingcontext2d.transform() api, canvas, canvasrenderingcontext2d, method, reference the canvasrenderingcontext2d.transform() method of the canvas 2d api multiplies the current transformation with the matrix described by the
arguments of this method.
...t: 1595 htmlcanvaselement: webglcontextrestored event webgl with the help of the webgl_lose_context extension, you can simulate the webglcontextrestored event: 1596 htmlcollection api, dom, dom reference, element lists, html dom, htmlcollection, interface, reference the htmlcollection interface represents a generic collection (array-like object similar to
arguments) of elements (in document order) and offers methods and properties for selecting from the list.
...And 6 more matches
Math.hypot() - JavaScript
the math.hypot() function returns the square root of the sum of squares of its
arguments, that is: math.hypot(v1,v2,…,vn)=∑i=1nvi2=v12+v22+…+vn2\mathtt{\operatorname{math.hypot}(v_1, v_2, \dots, v_n)} = \sqrt{\sum_{i=1}^n v_i^2} = \sqrt{v_1^2 + v_2^2 + \dots + v_n^2} the source for this interactive example is stored in a github repository.
... return value the square root of the sum of squares of the given
arguments.
... if at least one of the
arguments cannot be converted to a number, nan is returned.
...And 6 more matches
NSS Tools crlutil
syntax to run the certificate revocation list management tool, type the command crlutil option [
arguments] where options and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
... options and
arguments options specify an action and are uppercase.
...And 5 more matches
Index
29 js::callargs jsapi reference, reference, référence(2), spidermonkey js::callargs is helper class encapsulating access to the callee, this value,
arguments, and argument count for a function call.
... 219 js_convert
arguments jsapi reference, obsolete, spidermonkey js_convert
arguments provides a convenient way to translate a series of js values into their corresponding js types with a single function call.
... 220 js_convert
argumentsva jsapi reference, obsolete, spidermonkey js_convert
argumentsva is to js_convert
arguments as vprintf is to printf.
...And 5 more matches
Working with windows in chrome code
the window.opendialog function works similarly, but lets you specify optional
arguments that can be referenced from the javascript code.
... example 1: passing data to window when opening it with opendialog when you open a window using window.opendialog or nsiwindowwatcher.openwindow, you can pass an arbitrary number of
arguments to that window.
...
arguments are simple javascript objects, accessible through window.
arguments property in the opened window.
...And 5 more matches
Using IndexedDB - Web APIs
// in case you want to support such an implementation, you can write: // var transaction = db.transaction(["customers"], idbtransaction.read_write); the transaction() function takes two
arguments (though one is optional) and returns a transaction object.
...s what it looks like: var objectstore = db.transaction("customers").objectstore("customers"); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if (cursor) { console.log("name for ssn " + cursor.key + " is " + cursor.value.name); cursor.continue(); } else { console.log("no more entries!"); } }; the opencursor() function takes several
arguments.
... cursor.continue(); } }; please see "idbcursor constants" for the valid direction
arguments.
...And 5 more matches
Actionscript Acceptance Tests - Archive of obsolete content
testname.as.asc_args this file specifies additional
arguments to pass to asc when compiling the test: # asc args for file # two modes are available: # override| all command line
arguments (except builtin.py) are ignored and replaced by these # merge| merge these args in with the current args # specifiy an arg that starts with -no will disable the arg...
...testname.as.avm_args this file specifies additional
arguments to pass to the shell when running the test - the user can use the special variable $dir to refer to the current directory.
... this example passes in another .abc file as an argument to the file being run: -- $dir/file.abc another use would be to pass a specific argument to the shell: -dtimeout this file can have multiple lines with different
arguments.
...And 4 more matches
CommandLine - Archive of obsolete content
handling command line
arguments with xulrunner for multiple instances application it's fairly easy to retrieve application specific command line
arguments in xulrunner when it's not a single instance application.
... an nsicommandline object is passed as the first argument of the launched window: example var cmdline = window.
arguments[0]; cmdline = cmdline.queryinterface(components.interfaces.nsicommandline); alert(cmdline.handleflagwithparam("test", false)); see also: chrome: command line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched.
... however, if you'd like to retrieve the latest command line
arguments (to open a file for example), a possible solution is to create your own command line handler.
...And 4 more matches
mach
you can add the command to your .profile so it will run automatically when you start the shell: source /path/to/mozilla-central/python/mach/bash-completion.sh this will enable tab completion of mach command names, and in the future it may complete flags and other
arguments too.
...the
arguments to the decorator are those that can be passed to the argparse.argumentparser constructor by way of sub-commands.
...the
arguments to the decorator are passed to argparse.argumentparser.add_argument().
...And 4 more matches
NSS tools : cmsutil
synopsis cmsutil [options]
arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
... to run cmsutil, type the command cmsutil option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
...And 4 more matches
NSS tools : cmsutil
synopsis cmsutil [options]
arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
... to run cmsutil, type the command cmsutil option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
...And 4 more matches
JS::CallArgs
this article covers features introduced in spidermonkey 17 helper class encapsulating access to the callee, this value,
arguments, and argument count for a function call.
...(3nd argument of jsnative) methods methods of js::callargs method description bool requireatleast(jscontext *cx, const char *fnname, unsigned required) returns true if there are at least required
arguments passed in.
... methods inherited from js::callargsbase method description unsigned length() const returns the number of
arguments..
...And 4 more matches
JS_AddArgumentFormatter
add or remove a format string handler for js_convert
arguments, js_push
arguments, js_convert
argumentsva, and js_push
argumentsva.
... formatter jsargumentformatter the function to be used to convert
arguments described by the given format.
...for a given format string, for example "aa", the formatter is called from js_convert
argumentsva like so: formatter(cx, "aa...", js_true, &sp, &ap); sp points into the
arguments array on the js stack, while ap points into the stdarg.h va_list on the c stack.
...And 4 more matches
XPCShell Reference
you can specify multiple js files to execute by using multiple -f
arguments, and the scripts will be executed in the order encountered.
... [scriptarg…] these are
arguments to be passed to the script.
... these
arguments are only passed to “scriptfile” and not the scripts designated by –f options.
...And 4 more matches
Details of the object model - JavaScript
"instances" created from constructor var jim = new employee; // parentheses can be omitted if the // constructor takes no
arguments.
...as with java, you can provide
arguments to constructors to initialize property values for instances.
... note: this may not work as expected if the constructor function is called with
arguments which convert to false (like 0 (zero) and empty string ("").
...And 4 more matches
ui/frame - Archive of obsolete content
so there are three cases to consider: sending messages from a frame script to the main add-on code sending messages from the main add-on code to all instances of a frame, across all browser windows sending messages from the main add-on code to a single instance of a frame, attached to a specific browser window in all cases, postmessage() takes two
arguments: the message itself and a targetorigin.
...this takes two
arguments, the message itself and a target origin.
...
arguments event : this contains two properties: source, which defines a postmessage() function which you can use to send messages back to this particular frame instance.
...And 3 more matches
Creating Dialogs - Archive of obsolete content
in addition, the opendialog() function can take additional
arguments beyond the first three.
... these
arguments are passed to the new dialog and placed in an array stored in the new window's
arguments property.
... you can pass as many
arguments as you wish.
...And 3 more matches
HTTP Cache
//github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping following four
arguments into a single one: private-browsing boolean flag anonymous load boolean flag app id number (0 for no app) is-in-browser boolean flag helper functions to create nsiloadcontextinfo objects: c++ consumers: functions at loadcontextinfo.h exported header js consumers: resource://gre/modules/loadcontextinfo.jsm modu...
...le methods two storage objects created with the same set of nsiloadcontextinfo
arguments are identical, containing the same cache entries.
... two storage objects created with in any way different nsiloadcontextinfo
arguments are strictly and completely distinct and cache entries in them do not overlap even when having the same uris.
...And 3 more matches
Task.jsm
if you specify a function that is not a generator, it is called with no
arguments, and the yield operator returns the return value of the function.
...; throw new task.result("value"); } note: if you want to exit early from a generator function, without returning a value for the task, you can just use the return statement without any
arguments.
... function async( atask ); async() is similar to spawn(), except that: it doesn't immediately start the task, rather it returns an "async function" that starts the task when the function is called; it binds the task to the async function's this object and
arguments; it requires the task to be a function.
...And 3 more matches
NSS tools : modutil
synopsis modutil [options] [[
arguments]] status this documentation is still work in progress.
...each option may take
arguments, anywhere from none to multiple
arguments.
...use this option with the -libfile, -ciphers, and -mechanisms
arguments.
...And 3 more matches
NSS Tools cmsutil
syntax to run cmsutil, type the command cmsutil option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...each option may take zero or more
arguments.
... options and
arguments options specify an action.
...And 3 more matches
NSS Tools pk12util
-o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [common-options] or pk12util -l p12file [-h tokenname] [-r] [common-options] where [common-options] = [-d dir] [-p dbprefix] [-k slotpasswordfile | -k slotpassword] [-w p12filepasswordfile | -w p12filepassword] syntax to run the pkcs #12 tool, type ther command pk12util option [
arguments] where option and
arguments are combinations of the options and
arguments listed in the following section.
...options may take zero or more
arguments.
... options and
arguments options specify an action.
...And 3 more matches
NSS tools : modutil
synopsis modutil [options]
arguments description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens.
...each option may take
arguments, anywhere from none to multiple
arguments.
...use this option with the -libfile, -ciphers, and -mechanisms
arguments.
...And 3 more matches
JIT Optimization Outcomes
icoptstub_genericsuccess icgetpropstub_readslot icgetpropstub_callgetter icgetpropstub_arraylength icgetpropstub_unboxedread icgetpropstub_unboxedreadexpando icgetpropstub_unboxedarraylength icgetpropstub_typedarraylength icgetpropstub_domproxyshadowed icgetpropstub_domproxyunshadowed icgetpropstub_genericproxy icgetpropstub_
argumentslength icsetpropstub_slot icsetpropstub_genericproxy icsetpropstub_domproxyshadowed icsetpropstub_domproxyunshadowed icsetpropstub_callsetter icsetpropstub_addslot icsetpropstub_setunboxed icgetelemstub_readslot icgetelemstub_callgetter icgetelemstub_readunboxed icgetelemstub_dense icgetelemstub_densehole icgetelemstub_typedarray icgetelemstub_argselement icgetelemstub_argselementst...
...the interpreted callee function either has too many parameters or is called with too many
arguments.
...the interpreted callee function requires an
arguments object to be created.
...And 3 more matches
Components.Constructor
contractid [, interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the
arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components.
...(this benefit is also partly a result of having to travel through the layer between the javascript engine and xpcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the
arguments given to components.constructor() when called.
... bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsisupports]" try { // someinputstream is an existing nsiinputstream // throws because bis hasn't been qi'd to nsibinaryinputstream bis.setinputstream(someinputstream); } catch (e) { bis.queryinterface(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // succeeds now } if two
arguments are given, the created instance will be nsisupports.queryinterface()'d to the xpcom interface whose name is the second argument: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", "nsibinaryinputstream"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsibinaryinputstream]" // somein...
...And 3 more matches
nsICommandLine
definitions
arguments any values found on the command line.
... method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void remove
arguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of
arguments in the command line.
... return value the position of the flag in the command line, or -1 if the flag is not found.getargument() gets the value an argument from the array of command-line
arguments, given the index into the argument list.
...And 3 more matches
nsIWindowWatcher
nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports a
arguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type...
... note: supported nsisupportsprimitive objects will be reflected into window.
arguments as the base type, however id, void and 64-bit primitive types are not currently supported and will reflect into window.
arguments as null.
... nsidomwindow openwindow( in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports a
arguments ); parameters aparent the parent window, if any.
...And 3 more matches
Element.classList - Web APIs
add or remove multiple classes div.classlist.add("foo", "bar", "baz"); div.classlist.remove("foo", "bar", "baz"); // add or remove multiple classes using spread syntax const cls = ["foo", "bar"]; div.classlist.add(...cls); div.classlist.remove(...cls); // replace class "foo" with class "bar" div.classlist.replace("foo", "bar"); versions of firefox before 26 do not implement the use of several
arguments in the add/remove/toggle methods.
...t.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0; function domtokenlist(){ if (!allowtokenlistconstruction) throw typeerror("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.tolocalestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=
arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val =
arguments[v] + "", checkifvalidclasslistentry("add", val); for (var i=0, len=proto.length, resstr=val; i !== len; ++i) if (this[i] === val) continue a; else resstr += " " + this[i]; this[len] = val, proto.length += 1, proto.value = resstr; } skippropchang...
...e = 1, ele.classname = proto.value, skippropchange = 0; }; domtokenlist.prototype.remove = function(){ for (var v=0, arglen=
arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v !== arglen; ++v) { val =
arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) if(is){ this[i-1]=this[i] }else{ if(this[i] !== val){ resstr+=this[i]+" "; }else{ is=1; } } if (!is) continue; delete this[len], proto.length -= 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange = 0; }; window.domtokenlist = domtokenlist; function whenpropchanges(){ var evt = window.event, prop = evt.propertynam...
...And 3 more matches
Window.openDialog() - Web APIs
the optional parameters, if present, are bundled up in a javascript array object and added to the newly created window as a property named window.
arguments.
...these parameters may be used, then, to pass
arguments to and from the dialog window.
... the
arguments to be passed to the new window (optional).
...And 3 more matches
Synchronous and asynchronous requests - Web APIs
function xhrsuccess() { this.callback.apply(this, this.
arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(url, callback /*, opt_arg1, opt_arg2, ...
... */) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.
arguments = array.prototype.slice.call(
arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.open("get", url, true); xhr.send(null); } usage: function showmessage(message) { console.log(message + this.responsetext); } loadfile("message.txt", showmessage, "new message!\n\n"); the signature of the utility function loadfile declares (i) a target url to read (via an http get request), (ii) a function to execute on successful completion of the xhr operation, and (iii) an arbitrary list of additional
arguments that are passed through the xhr object (via the
arguments property) to the success callback function.
...the additional
arguments (if any) supplied to the invocation of function loadfile are "applied" to the running of the callback function.
...And 3 more matches
Indexed collections - JavaScript
the array's length property is set to the number of
arguments.
... the callback function is called with two
arguments, that are array's elements.
... working with array-like objects some javascript objects, such as the nodelist returned by document.getelementsbytagname() or the
arguments object made available within the body of a function, look and behave like arrays on the surface but do not share all of their methods.
...And 3 more matches
Arrow function expressions - JavaScript
an arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this,
arguments, super, or new.target keywords.
... var adder = { base: 1, add: function(a) { var f = v => v + this.base; return f(a); }, addthrucall: function(a) { var f = v => v + this.base; var b = { base: 2 }; return f.call(b, a); } }; console.log(adder.add(1)); // this would log 2 console.log(adder.addthrucall(1)); // this would log 2 still no binding of
arguments arrow functions do not have their own
arguments object.
... thus, in this example,
arguments is simply a reference to the
arguments of the enclosing scope: var
arguments = [1, 2, 3]; var arr = () =>
arguments[0]; arr(); // 1 function foo(n) { var f = () =>
arguments[0] + n; // foo's implicit
arguments binding.
...And 3 more matches
Array.prototype.map() - JavaScript
the callback function accepts the following
arguments: currentvalue the current element being processed in the array.
... parameters in detail callback is invoked with three
arguments: the value of the element, the index of the element, and the array object being mapped.
... if (
arguments.length > 1) { t =
arguments[1]; } // 6.
...And 3 more matches
Function - JavaScript
instance properties function.
arguments an array corresponding to the
arguments passed to a function.
...use the
arguments object (available within the function) instead.
... function.length specifies the number of
arguments expected by the function.
...And 3 more matches
String.prototype.substring() - JavaScript
if indexstart is greater than indexend, then the effect of substring() is as if the two
arguments were swapped; see example below.
... the
arguments of substring() represent the starting and ending indexes, while the
arguments of substr() represent the starting index and the number of characters to include in the returned string.
... let text = 'mozilla' console.log(text.substring(2,5)) // => "zil" console.log(text.substr(2,3)) // => "zil" differences between substring() and slice() the substring() and slice() methods are almost identical, but there are a couple of subtle differences between the two, especially in the way negative
arguments are dealt with.
...And 3 more matches
Transitioning to strict mode - JavaScript
differences from non-strict to strict syntax errors when adding 'use strict';, the following cases will throw a syntaxerror before the script is executing: octal syntax var n = 023; with statement using delete on a variable name delete myvariable; using eval or
arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected, public, static, and yield declaring function in blocks if (a < b) { function f() {} } obvious errors declaring twice the same name for a property name in an object literal {a: 1, b: 3, a: 7} this is no longer the case ...
... poisoned
arguments and function properties accessing
arguments.callee,
arguments.caller, anyfunction.caller, or anyfunction.
arguments throws an error in strict mode.
... the only legitimate use case would be to reuse a function as in: // example taken from vanillajs: http://vanilla-js.com/ var s = document.getelementbyid('thing').style; s.opacity = 1; (function() { if ((s.opacity-=.1) < 0) s.display = 'none'; else settimeout(
arguments.callee, 40); })(); which can be rewritten as: 'use strict'; var s = document.getelementbyid('thing').style; s.opacity = 1; (function fadeout() { // name the function if((s.opacity-=.1) < 0) s.display = 'none'; else settimeout(fadeout, 40); // use the name of the function })(); semantic differences these differences are very subtle differences.
...And 3 more matches
Dialogs and Prompts - Archive of obsolete content
passing
arguments and displaying a dialog the following code demonstrates how to pass custom
arguments to a dialog, process those
arguments in the dialog, and return user-modified
arguments to the caller.
... the code to open a dialog named mydialog.xul and pass it
arguments: var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null}; window.opendialog("chrome://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok.
... process changed
arguments; e.g.
...And 2 more matches
OpenClose - Archive of obsolete content
the openpopup method takes six
arguments which are used to specify how and where the popup should be positioned.
... the third and fourth
arguments to openpopup are x and y offsets.
... finally, the last argument to the openpopup method, attributesoverride indicates whether attributes placed on the popup element itself override the
arguments supplied.
...And 2 more matches
menupopup - Archive of obsolete content
x, y for an anchored popup, the x and y
arguments may be used to offset the popup from its anchored position by some number, measured in css pixels.
...in this case, the position and attributesoverride
arguments are ignored.
...in this latter case, the anchor and align
arguments may be used to further control where the popup appears relative to the element.
...And 2 more matches
tooltip - Archive of obsolete content
x, y for an anchored popup, the x and y
arguments may be used to offset the popup from its anchored position by some number, measured in css pixels.
...in this case, the position and attributesoverride
arguments are ignored.
...in this latter case, the anchor and align
arguments may be used to further control where the popup appears relative to the element.
...And 2 more matches
PromiseWorker.jsm
aargs an array of
arguments to pass to the function named afunctionname in the worker file.
... if the worker function does not have any
arguments and the empty array should be passed here.
... if any of the
arguments is a promise, it is resolved before posting the message.
...And 2 more matches
Mozilla DOM Hacking Guide
this means that when we use the dom from javascript, we pass
arguments that have no type.
... static jsval *sx_id: strings used in the global resolve methods for comparison with the passed in
arguments.
... #define dom_classinfo_map_entry(_if) &ns_get_iid(_if), the array of pointers interface_list is filled with the addresses of the iid's of all the interfaces passed as
arguments to the macro.
...And 2 more matches
JS_ConstructObject
as of spidermonkey 1.8.8, js_constructobject and js_constructobjectwith
arguments have been removed from the jsapi.
... syntax jsobject * js_constructobject(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent); jsobject * js_constructobjectwith
arguments(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent, unsigned int argc, jsval *argv); name type description cx jscontext * the context in which to create the new object.
... argc unsigned int (only in js_constructobjectwith
arguments) the number of
arguments to pass to the constructor.
...And 2 more matches
mozIStorageConnection
d overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anum
arguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8string asqlstatement); void createfunction(in autf8string afunctionname, in long anum
arguments, in mozistoragefunction afunction); mozistoragestatement createstatement(in autf8string asqlstatement); void createtable(in string atablename, in string atableschema)...
... void createaggregatefunction( in autf8string afunctionname, in long anum
arguments, in mozistorageaggregatefunction afunction ); parameters afunctionname the name of the aggregate function to create, as seen in sql.
... anum
arguments the number of
arguments the function takes.
...And 2 more matches
mozIStorageFunction
last changed in gecko 1.9.1.4 (firefox 3.5.4) inherits from: nsisupports method overview nsivariant onfunctioncall(in mozistoragevaluearray afunction
arguments); methods onfunctioncall() the implementation of the function.
... nsivariant onfunctioncall( in mozistoragevaluearray afunction
arguments ); parameters afunction
arguments a mozistoragevaluearray holding the
arguments passed in to the function.
... javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(a
arguments) { let value = a
arguments.getint32(0); return value * value; }); // run some query that uses the function.
...And 2 more matches
MailNews fakeserver
a handler will contain the following methods: <caption> handler methods </caption> name
arguments returns notes [command] rest of sent line server's response the name is normalized to be uppercase.
...the server presents the following api to the handler: <caption> server api </caption> name
arguments returns description closesocket none nothing closes the socket and stops the test.
...the server provides the following api to xpcshell tests: <caption> nsmailserver xpcshell api </caption> name
arguments returns description performtest none nothing runs until the test is forcibly aborted or stopped normally isstopped none if the server is stopped helper for performtest istestfinished none if the test is finished helper for performtest playtransaction none the transaction the transaction is an object with two properties: us, and them; us is an array of responses we sent, them an array of c...
...And 2 more matches
CSSStyleSheet.insertRule() - Web APIs
' !important' : '') + ';\n'; } // insert css rule stylesheet.insertrule(selector + '{' + propstr + '}', stylesheet.cssrules.length); } } polyfill the below polyfill will correct the input of the
arguments of insertrule() to standardize them in internet explorer 5–8.
... it supplements insertrule() with a function that separates the selector from the rules before sending the
arguments to the default native insertrule().
... (function(sheet_proto){ var originalinsertrule = sheet_proto.insertrule; if (originalinsertrule.length === 2){ // 2 mandatory
arguments: (selector, rules) sheet_proto.insertrule = function(selectorandrule){ // first, separate the selector from the rule a: for (var i=0, len=selectorandrule.length, isescaped=0, newcharcode=0; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 123)) { // 123 = "{".charcodeat(0) // secondly, find the last closing bracket var openbracketpos = i, closebracketpos = -1; for (; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 125)) { // 125 = "}".charcodeat(0) closebracketp...
...And 2 more matches
Numbers and dates - JavaScript
for example, if you want to use the trigonometric function sine, you would write math.sin(1.56) note that all trigonometric methods of math take
arguments in radians.
... min(), max() returns the minimum or maximum (respectively) value of a comma separated list of numbers as
arguments.
... sqrt(), cbrt(), hypot() square root, cube root, square root of the sum of square
arguments.
...And 2 more matches
Array.prototype.reduce() - JavaScript
the reducer function takes four
arguments: accumulator (acc) current value (cur) current index (idx) source array (src) your reducer function's returned value is assigned to the accumulator, whose value is remembered across each iteration throughout the array, and ultimately becomes the final, single resulting value.
... it takes four
arguments: accumulator the accumulator accumulates callback's return values.
... description the reduce() method executes the callback once for each assigned value present in the array, taking four
arguments: accumulator currentvalue currentindex array the first time the callback is called, accumulator and currentvalue can be one of two values.
...And 2 more matches
Date.prototype.toLocaleDateString() - JavaScript
the new locales and options
arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function.
... in older implementations, which ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation dependent.
... syntax dateobj.tolocaledatestring([locales [, options]]) parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 2 more matches
Date.prototype.toLocaleString() - JavaScript
the new locales and options
arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function.
... in older implementations, which ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation-dependent.
... syntax dateobj.tolocalestring([locales[, options]]) parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 2 more matches
Date.prototype.toLocaleTimeString() - JavaScript
the new locales and options
arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function.
... in older implementations, which ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation dependent.
... syntax dateobj.tolocaletimestring([locales[, options]]) parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 2 more matches
Object - JavaScript
when a function is called, the
arguments to the call are held in the array-like "variable"
arguments.
... for example, in the call myfn(a, b, c), the
arguments within myfn's body will contain 3 array-like elements corresponding to (a, b, c).
... when modifying prototypes with hooks, pass this and the
arguments (the call state) to the current behavior by calling apply() on the function.
...And 2 more matches
handler.construct() - JavaScript
syntax const p = new proxy(target, { construct: function(target,
argumentslist, newtarget) { } }); parameters the following parameters are passed to the construct() method.
...
argumentslist the list of
arguments for the constructor.
... const p = new proxy(function() {}, { construct: function(target,
argumentslist, newtarget) { console.log('called: ' +
argumentslist.join(', ')); return { value:
argumentslist[0] * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code violates the invariant.
...And 2 more matches
Reflect.apply() - JavaScript
the static reflect.apply() method calls a target function with
arguments as specified.
... syntax reflect.apply(target, thisargument,
argumentslist) parameters target the target function to call.
...
argumentslist an array-like object specifying the
arguments with which target should be called.
...And 2 more matches
Reflect.construct() - JavaScript
syntax reflect.construct(target,
argumentslist[, newtarget]) parameters target the target function to call.
...
argumentslist an array-like object specifying the
arguments with which target should be called.
... return value a new instance of target (or newtarget, if present), initialized by target as a constructor with the given
argumentslist.
...And 2 more matches
String.prototype.localeCompare() - JavaScript
the new locales and options
arguments let applications specify the language whose sort order should be used and customize the behavior of the function.
... in older implementations, which ignore the locales and options
arguments, the locale and sort order used are entirely implementation-dependent.
... locales and options these
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 2 more matches
Spread syntax (...) - JavaScript
spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more
arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
... examples spread in function calls replace apply() it is common to use function.prototype.apply() in cases where you want to use the elements of an array as
arguments to a function.
...meters without spread syntax, you would have to do it indirectly through partial application: function applyandnew(constructor, args) { function partial () { return constructor.apply(this, args); }; if (typeof constructor.prototype === "object") { partial.prototype = object.create(constructor.prototype); } return partial; } function myconstructor () { console.log("
arguments.length: " +
arguments.length); console.log(
arguments); this.prop1="val1"; this.prop2="val2"; }; const my
arguments = ["hi", "how", "are", "you", "mr", null]; const myconstructorwith
arguments = applyandnew(myconstructor, my
arguments); console.log(new myconstructorwith
arguments); // (internal log of myconstructor):
arguments.length: 6 // (internal log of myconstructor): ...
...And 2 more matches
widget - Archive of obsolete content
arguments widgetview : the related widgetview object.
...
arguments widgetview : listeners are passed a single argument which is the widgetview that triggered the click event.
...
arguments value : listeners are passed a single argument which is the message posted from the content script.
...
arguments value : listeners are passed a single argument which is the message posted from the content script.
windows - Archive of obsolete content
arguments window : listeners are passed the window object that triggered the event.
...
arguments window : listeners are passed the window object that triggered the event.
...
arguments window : listeners are passed the window object that has become active.
...
arguments window : listeners are passed the window object that has become inactive.
core/promise - Archive of obsolete content
the composed function may take both normal values and promises as
arguments and returns promise.
... the returned promise will resolve to value that would have been returned by an original function if it were called with fulfillment values of given
arguments.
...in the following example we implement functions that take multiple promises and return one that resolves to first one being fulfilled: function race() { let { promise, resolve } = defer(); array.slice(
arguments).foreach(function(promise) { promise.then(resolve); }); return promise; } var asyncaorb = race(readasync(urla), readasync(urlb)); note: that this implementation forgives failures and would fail if all promises fail to resolve.
...in such cases it's usually easier to wrap value into promise than branch on value type: function or(a, b) { var second = resolve(b).then(function(bvalue) { return !!bvalue }); return resolve(a).then(function(avalue) { return !!avalue || second; }, function() { return second; }) } note: we could not use promised function here, as they reject returned promise if any of the given
arguments is rejected.
places/bookmarks - Archive of obsolete content
invoked with two
arguments, mine and platform, where mine is the item that is being saved, and platform is the current state of the item on the item.
... let { search } = require("sdk/places/bookmarks"); search({ query: "firefox" }).on("data", function (item) { // each bookmark item that matches the query will // be called in this function });
arguments bookmark|group|separator : for the save function, this is the saved, latest snapshot of the bookmark item.
...
arguments string : a string indicating the error that occurred.
...
arguments array : the array is an ordered list of the input bookmark items, replaced with their updated, latest snapshot instances (the first argument in the data handler), or in the case of an error, the initial instance of the item that was used for the save request (the second argument in the data or error handler).
ui/toolbar - Archive of obsolete content
this may be passed
arguments, depending on the particular event.
...this may be passed
arguments, depending on the particular event.
...e toolbar instance that was shown: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("show", showing); function showing(e) { console.log("showing"); console.log(e.title); console.log(e.items[0]); console.log(e.hidden); }
arguments toolbar : the toolbar that was shown.
...the toolbar instance that was hidden: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("hide", hiding); function hiding(e) { console.log("hiding"); console.log(e.title); console.log(e.items[0]); console.log(e.hidden); }
arguments toolbar : the toolbar that was hidden.
util/object - Archive of obsolete content
globals functions merge(source,
arguments) merges all of the properties of all
arguments into the first argument.
...
arguments : object n amount of additional objects that are merged into source object.
... extend(
arguments) returns an object that inherits from the first argument and contains all of the properties from all following
arguments, with precedence from right to left.
... let { extend } = require("sdk/util/object"); var a = { alpha: "a" }; var b = { beta: "b" }; var g = { gamma: "g", alpha: null }; var x = extend(a, b, g); console.log(a); // { alpha: "a" } console.log(b); // { beta: "b" } console.log(g); // { gamma: "g", alpha: null } console.log(x); // { alpha: null, beta: "b", gamma: "g" } parameters
arguments : object n
arguments that get merged into a new object.
console - Archive of obsolete content
console methods all console methods except exception() and trace() accept one or more javascript objects as
arguments and log them to the console.
... console.error(object[, object, ...]) logs the
arguments to the console, preceded by "error:" and the name of your add-on: console.error("this is an error message"); error: my-addon: this is an error message console.exception(exception) logs the given exception instance as an error, outputting information about the exception's stack traceback if one is available.
... console.log(object[, object, ...]) logs the
arguments to the console, preceded by "info:" and the name of your add-on: console.log("this is an informational message"); info: my-addon: this is an informational message console.time(name) starts a timer with a name specified as an input parameter.
... console.warn(object[, object, ...]) logs the
arguments to the console, preceded by "warn:" and the name of your add-on: console.warn("this is a warning message"); warn: my-addon: this is a warning message logging levels logging's useful, of course, especially during development.
jpm - Archive of obsolete content
--binary-args cmdargs pass extra
arguments to firefox.
... for example, to pass the -jsconsole argument to firefox and launch the browser console, try the following: jpm run --binary-args -jsconsole to pass multiple
arguments, or
arguments containing spaces, quote them: jpm run --binary-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on.
... --binary-args cmdargs pass extra
arguments to firefox.
... for example, to pass the -jsconsole argument to firefox, which will launch the browser console, try the following: jpm test --binary-args -jsconsole to pass multiple
arguments, or
arguments containing spaces, quote them: jpm test --binary-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on.
Index - Archive of obsolete content
60 system add-on sdk query the add-on's environment and access
arguments passed to it.
...finally, there are 1 or more sets of key generation
arguments.
... 1956 commandline command line, guide, needsupdate, xul, xulrunner it's fairly easy to retrieve application specific command line
arguments in xulrunner when it's not a single instance application.
... 2076
arguments.caller functions, javascript, obsolete, property,
arguments the obsolete
arguments.caller property used to provide the function that invoked the currently executing function.
Tree Box Objects - Archive of obsolete content
the getrowat() function takes two
arguments, the x and y coordinates to use.
...knife"/> <treecell label="2"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="spoon"/> <treecell label="8"/> </treerow> </treeitem> </treechildren> </tree> <label value="row:"/> <label id="row"/> <label value="column:"/> <label id="column"/> <label value="child type:"/> <label id="part"/> the getcellat() function takes five
arguments, the coordinates to look up and three out parameters.
...it takes seven
arguments, as described below.
... var x = {}, y = {}, width = {}, height = {}; if (typeof tree.columns != "undefined") column = tree.columns[column]; tree.boxobject.getcoordsforcellitem( row, column, part, x, y, width, height ); the row, column, and part
arguments are similar to those returned from the getcellat() function.
MacFAQ - Archive of obsolete content
this is implemented in a pseudo "hidden window" technique and parsing the window
arguments instead of command-line handlers and some of the toolkit singleton window code.
... to navigator.xul, and this is called when an xulrunner app is already running, so: create a default preference of "browser.chromeurl" that points to your new "hiddenwindow" as such: "chrome://myxul/content/hiddenwindow.xul" next take the code below and drop it in, to create the hiddenwindow.xul (note: the debug function and nsicommandline try/catch can be removed, all you need is the window.
arguments[0]) <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myxul_hidden" windowtype="myxul:hiddenwindow" title="" width="0" height="0" persist="screenx screeny width height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><...
...spreferences.copyunicharpref("toolkit.singletonwindowtype"); var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singletonwindowtype); if (win) { window.close(); win.focus(); } } if (window.
arguments && window.
arguments[0]){ try { var cmdline = window.
arguments[0] .queryinterface(components.interfaces.nsicommandline); for (var i = 0; i < cmdline.length; ++i) { debug(cmdline.getargument(i)) } } catch(ex) { debug(window.
arguments[0]) // do something with window.
arguments[0] //nspreferences.setunichar...
...pref("myxul.cmdlinevalue", window.
arguments[0]) } window.addeventlistener("load", checkotherwindows , false); } ]]></script> </window> ...
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
parameter variables are used to import
arguments into functions.
... note the difference between parameters and
arguments: function parameters are the names listed in the function's definition.
... function
arguments are the real values passed to the function.
... parameters are initialized to the values of the
arguments supplied.
Command line options
if the option contains
arguments, enter the argument after the option.
...in some cases, option
arguments must be enclosed in quotation marks (this is noted in the option descriptions below).
... note: since firefox 2.0.0.7, use of the -install-global-extension and -install-global-theme command line
arguments have been restricted to only allow installing add-ons that are on local disks or mapped drives.
...useful with those command-line
arguments that open their own windows but don't already prevent default windows from opening.
Debugging on Mac OS X
select the "
arguments" tab in the scheme editor, and click the '+' below the "
arguments passed on launch" field.
... also in the "
arguments" panel, you may want to add an environment variable moz_debug_child_process set to the value 1 to help with debugging e10s.
...click the plus icon under the "
arguments" list and type "-p <profile name>" (e.g.
... on the same tab, under "launch" select "wait for executable to be launched" on the "
arguments" tab, remove all
arguments passed on launch.
Sqlite.jsm
these functions receive the following
arguments: readonly (optional) if true the clone will be read-only, default is false.
... these functions receive the following
arguments: sql (required) string sql statement to execute.
...with positional
arguments, it is simple to modify the parameter count or positions without fixing all users of the statement.
... this function receives the following
arguments: func the function defining the transaction body.
Functions
if we can prove at compile time that a function does not refer to any locals or
arguments of enclosing functions, it is a null closure.
...an algol-like function may read the local variables and
arguments of its immediate enclosing function from the stack, as if by magic.
...if the function does not assign to any closed-on vars/args, and it only reads closed-on local variables and
arguments that never change value after the function is created, then the function can be implemented as a flat closure.
...because
arguments and locals can't be deleted, this optimization is available to all functions, and eval does not interfere with it.
JSAPI Cookbook
or "x = new object" /* jsapi */ js::rootedobject x(cx, js_newplainobject(cx)); // or js_newobject(cx, js::nullptr(), js::nullptr(), js::nullptr()); if (!x) return false; constructing an object with new // javascript var person = new person("dave", 24); it looks so simple in javascript, but a jsapi application has to do three things here: look up the constructor, person prepare the
arguments ("dave", 24) call js_new to simulate the new keyword (if your constructor doesn't take any
arguments, you can skip the second step and call js_new(cx, constructor, 0, null) in step 3.) /* jsapi */ /* step 1 - get the value of |person| and check that it is an object.
... */ js::rootedvalue constructor_val(cx); if (!js_getproperty(cx, js_getglobalobject(cx), "person", &constructor_val)) return false; if (!constructor_val.isobject()) { js_reporterror(cx, "person is not a constructor"); return false; } js::rootedobject constructor(cx, &constructor_val.toobject()); /* step 2 - set up the
arguments.
... */ js::rootedstring name_str(cx, js_newstringcopyz(cx, "dave")); if (!name_str) return false; js::autovaluearray<2> args(cx); args[0].setstring(name_str); args[1].setint32(24); /* step 3 - call |new person(...args)|, passing the
arguments.
...jsapi code can override this by creating the error object directly and passing additional
arguments to the constructor: // javascript throw new error(message, filename, lineno); /* jsapi */ bool throwerror(jscontext *cx, jsobject *global, const char *message, const char *filename, int32 lineno) { jsstring *messagestr; jsstring *filenamestr; js::value args[3]; js::value exc; messagestr = js_newstringcopyz(cx, message); if (!messagestr) return f...
JS::CompileFunction
nargs unsigned number of
arguments to pass to the function.
... argnames const char *const * names to assign to the
arguments passed to the function.
...nargs is the number of
arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument.
... the number of argument names should match the number of
arguments specified in nargs.
JS_CompileFunction
nargs unsigned int number of
arguments to pass to the function.
... argnames const char ** names to assign to the
arguments passed to the function.
...nargs is the number of
arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument.
... the number of argument names should match the number of
arguments specified in nargs.
JS_CompileFunctionForPrincipals
nargs unsigned int number of
arguments to pass to the function.
... argnames const char ** names to assign to the
arguments passed to the function.
...nargs is the number of
arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument.
... the number of argument names should match the number of
arguments specified in nargs.
Index
here is the interface, and a description of its use.</t> 10 how to pass an xpcom object to a new window needsexample, needshelp if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the
arguments to the window creation method.
...if endoffset is lower than startoffset, the result is the same as a call with the two
arguments exchanged.
...on preference changes, the following
arguments will be passed to nsiobserver.observe(): 831 nsipreflocalizedstring interfaces, interfaces:scriptable, preferences, xpcom, xpcom interface reference used to set the contents of this object.
...unlike createinstance, this will always return the same object each time it is called with the same
arguments.
mozIStorageAggregateFunction
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onstep(in mozistoragevaluearray afunction
arguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the query.
... void onstep( in mozistoragevaluearray afunction
arguments ); parameters afunction
arguments a mozistoragevaluearray holding the
arguments passed in to the function.
...var standarddeviationfunc = { _numbers: [], onstep: function(a
arguments) { this._numbers.push(a
arguments.getint32(0)); }, onfinal: function() { let total = 0; let ilength = this._numbers.length; this._numbers.foreach(function(elt) { total += elt }); let mean = total / this._numbers.length; let data = this._numbers.map(function(elt) { let value = elt - mean; return value * value; }); total = 0; data.foreach(function(...
...class standarddeviationfunc : public mozistorageaggregatefunction { public: ns_imethod onstep(mozistoragevaluearray *a
arguments) { print32 value; nsresult rv = a
arguments->getint32(&value); ns_ensure_success(rv, rv); mnumbers.appendelement(value); } ns_imethod onfinal(nsivariant **_result) { print64 total = 0; for (pruint32 i = 0; i < mnumbers.length(); i++) total += mnumbers[i]; print32 mean = total / mnumbers.length(); nstarray<print64> data(mnumbers); for (pruint32 i...
nsIXmlRpcClient
init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports
arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most recent xml-rpc fault from returned from this server.
...the default charset if this function is not called is "utf-8" void setauthentication ( in string encoding ) ; parameters encoding encoding charset to be used asynccall() call remote method methodname asynchronously with given
arguments.
... supported
arguments are: nsisupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsiinputstream: base64, nsisupportsarray: array, nsidictionary: struct note that both nsisupportsarray and nsidictionary can only hold any of the supported input types.
...parameters listener a nsixmlrpcclientlistener that will get notified of xml-rpc events ctxt a context to be passed on to the listener methodname remote method to call
arguments array of
arguments to pass to the remote method count void asynccall ( in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, [array, size_is(count)] in nsisupports
arguments, in pruint32 count ); createtype() convenience: return the correct nsisupportsprimitive for a given xml-rpc type, or nsisupportsarray or nsidictionary.
Debugger.Object - Firefox Developer Tools
bound
arguments if the referent is a bound debuggee function, this is an array (in the debugger object’s compartment) that contains the debuggee values of the
arguments object it was bound to.
... return values of promise.all() if the referent promise was passed in as one of the
arguments.
... return values of promise.race() if the referent promise was passed in as one of the
arguments.
... apply(this,
arguments) if the referent is callable, call it with the giventhis value and the argument values in
arguments, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invokefunction as a constructor, in which case spidermonkey provides an appropriate this value itself.
arguments must either be an array (in the debugger) of debuggee value...
DevTools API - Firefox Developer Tools
when an event is emitted on the eventemitter, the listeners will be called with the event name as the first argument and the extra
arguments are spread as the remaining parameters.
... emit(eventname, ...extra
arguments) emits an event with the given name to this object.
... extra
arguments {...any} - extra
arguments that are passed to the listeners.
...if the event contains multiple payload
arguments, the rest are discarded and can only be received by providing the listener function to this method.
console - Web APIs
you may use string substitution and additional
arguments with this method.
...you may use string substitution and additional
arguments with this method.
...you may use string substitution and additional
arguments with this method.
...you may use string substitution and additional
arguments with this method.
<basic-shape> - CSS: Cascading Style Sheets
when all of the first four
arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle.
... these
arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values.
...) the <shape-radius>
arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order.
... the required <string> is an svg path string encompassed in quotes the
arguments not defined above are defined as follows: <shape-arg> = <length> | <percentage> <shape-radius> = <length> | <percentage> | closest-side | farthest-side defines a radius for a circle or ellipse.
Array.prototype.reduceRight() - JavaScript
syntax arr.reduceright(callback(accumulator, currentvalue[, index[, array]])[, initialvalue]) parameters callback function to execute on each value in the array, taking four
arguments: accumulator the value previously returned in the last invocation of the callback, or initialvalue, if supplied.
... description reduceright executes the callback function once for each element present in the array, excluding holes in the array, receiving four
arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.
... some example run-throughs of the function would look like this: [0, 1, 2, 3, 4].reduceright(function(accumulator, currentvalue, index, array) { return accumulator + currentvalue; }); the callback would be invoked four times, with the
arguments and return values in each call being as follows: callback accumulator currentvalue index array return value first call 4 3 3 [0, 1, 2, 3, 4] 7 second call 7 2 2 [0, 1, 2, 3, 4] 9 third call 9 1 1 [0, 1, 2, 3, 4] 10 fourth call 10 0 0 [0, 1, 2, 3, 4] 10 the value retu...
....reduceright = function(callback /*, initialvalue*/) { 'use strict'; if (null === this || 'undefined' === typeof this) { throw new typeerror('array.prototype.reduce called on null or undefined'); } if ('function' !== typeof callback) { throw new typeerror(callback + ' is not a function'); } var t = object(this), len = t.length >>> 0, k = len - 1, value; if (
arguments.length >= 2) { value =
arguments[1]; } else { while (k >= 0 && !(k in t)) { k--; } if (k < 0) { throw new typeerror('reduce of empty array with no initial value'); } value = t[k--]; } for (; k >= 0; k--) { if (k in t) { value = callback(value, t[k], k, t); } } return value; }; } examples sum up all va...
Array.from() - JavaScript
var mapfn =
arguments.length > 1 ?
...
arguments[1] : void undefined; var t; if (typeof mapfn !== 'undefined') { // 5.
... if (
arguments.length > 2) { t =
arguments[2]; } } // 10.
...] array from a set const set = new set(['foo', 'bar', 'baz', 'foo']); array.from(set); // [ "foo", "bar", "baz" ] array from a map const map = new map([[1, 2], [2, 4], [4, 8]]); array.from(map); // [[1, 2], [2, 4], [4, 8]] const mapper = new map([['1', 'a'], ['2', 'b']]); array.from(mapper.values()); // ['a', 'b']; array.from(mapper.keys()); // ['1', '2']; array from an array-like object (
arguments) function f() { return array.from(
arguments); } f(1, 2, 3); // [ 1, 2, 3 ] using arrow functions and array.from() // using an arrow function as the map function to // manipulate the elements array.from([1, 2, 3], x => x + x); // [2, 4, 6] // generate a sequence of numbers // since the array is initialized with `undefined` on each position, // the value of `v` below will be `undefined` ar...
Function.prototype.call() - JavaScript
the call() method calls a function with a given this value and
arguments provided individually.
... arg1, arg2, ...argn optional
arguments for the function.
... return value the result of calling the function with the specified this value and
arguments.
... note: while the syntax of this function is almost identical to that of apply(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of
arguments.
Number.prototype.toLocaleString() - JavaScript
syntax numobj.tolocalestring([locales [, options]]) parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations, which ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation dependent.
...english locale checking for support for locales and options
arguments the locales and options
arguments are not supported in all browsers yet.
...tations, 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.
new operator - JavaScript
syntax new constructor[([
arguments])] parameters constructor a class or function that specifies the type of the object instance.
...
arguments a list of values that the constructor will be called with.
... the constructor function foo is called with the specified
arguments, and with this bound to the newly created object.
...if no argument list is specified, foo is called without
arguments.
lang/type - Archive of obsolete content
is
arguments(value) returns true if value is an array-like
arguments object, false otherwise.
... let { is
arguments } = require('sdk/lang/type'); function run () { is
arguments(
arguments); // true is
arguments([]); // false is
arguments(array.slice(
arguments)); // false } run(1, 2, 3); parameters value : mixed the variable to check.
... returns boolean : boolean indicating if value is an
arguments object.
places/history - Archive of obsolete content
arguments object : this is an object representing a history entry.
...
arguments string : a string indicating the error that occurred.
...
arguments array : the value passed into the handler is an array of all entries found in the history search.
Appendix F: Monitoring DOM changes - Archive of obsolete content
for instance, when you want to modify the result of dom mutations that you know are the result of the doawesomedomstuff() function, you can wrap it as follows: { let originaldoawesomedomstuff = doawesomedomstuff; doawesomedomstuff = function _doawesomedomstuff() { let res = originaldoawesomedomstuff.apply(this,
arguments); doawesomerdomstuff(res,
arguments); return res; }; } now, whenever doawesomedomstuff() is called, the original function will be called, followed by your own doawesomerdomstuff() function, which can then further modify the dom as needed.
... variations on this method include modifying the
arguments passed to the wrapped function, modifying its return value, and making changes both before and after the original method is called.
...for instance, if you need to know about attribute changes to a particular node, then you should replace its setattribute method with a function that calls the original setattribute function as originalsetattribute.apply(this,
arguments) before running your necessary event code.
Dehydra Function Reference - Archive of obsolete content
require supports optional named
arguments via javascript object where each parameter is a property.
..."gnu c" or "gnu c++")
arguments this.
arguments is a javascript array containing command-line
arguments passed to a script.
... -fplugin-arg="foo.js a b c" would run foo.js with ["a", "b", "c"]
arguments array.
execute - Archive of obsolete content
passing
arguments to the executable the args parameter, when present, passes a string to the executable as command-line parameters.
...in general, you should use single quotes for the args string and double quotes to delimit the command-line
arguments within args.
... this means that in order to pass three command-line
arguments (-c, -d, and -s) to the executable, you should format the args string as follows: err = file.execute(myfile, '"-c""-d""-s"', true); //technically, given the rules above, you could also pass the same //
arguments with the following line, but the result is much less //readable: err = file.execute(myfile, "\"-c\"\"-d\"\"-s\"", true); also see the note about binaries on the macintosh platform in ad...
Properties - Archive of obsolete content
c:\temp\argstest.xpi)
arguments args can be passed in through the triggering apis by attaching a ?
...startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.
arguments being argument_string #).
...everything after the question mark is treated as one string which becomes the install.
arguments property.
Reading from Files - Archive of obsolete content
the newinputstream method takes two
arguments in this example.
...this method actually takes a number of additional
arguments, however they are optional so they do not need to be specified if they aren't needed.
... these extra
arguments will be discussed later.
showPopup - Archive of obsolete content
in this latter case, the anchor and align
arguments may be used to further control where the popup appears relative to the element.
...the anchor and align
arguments are ignored if either x or y are not -1.
... to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y
arguments offset by the desired values.
Positioning - Archive of obsolete content
positioning using coordinates a popup can be positioned further using the x and y
arguments to openpopup.
... after the popup is positioned using the anchor, the x and y
arguments may be used to offset the popup by a certain distance.
...as with the position attribute, the
arguments to the openpopup method override unless the last argument is set to true.
Install Scripts - Archive of obsolete content
this function takes two
arguments, the first is the identifier and the second is a subdirectory.
...it takes two
arguments, the first is the type of chrome to register (content, skin or locale).
...it takes no
arguments.
NPN_Invoke - Archive of obsolete content
args an array of
arguments to pass to the method.
... argcount the number of
arguments in the args array.
...description the method
arguments are passed as an array of npvariants, and the number of
arguments is passed in.
NPN_InvokeDefault - Archive of obsolete content
args an array of
arguments to pass to the default method.
... argcount the number of
arguments in the args array.
...description the method
arguments are passed as an array of npvariants, and the number of
arguments is passed in.
E4X for templating - Archive of obsolete content
createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.prototype.slice.call(
arguments, 1); return strs.formatstringfromname(msg,args,args.length); } return strs.getstringfromname(msg); } for example, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''...
... /* the first two
arguments are optional: (h is a handler with an explicit argument v only, or beginning with k, v) lev is optional argument to note recursive depth (if part of recursion) */ function foreach (min, max, arr, h, lev) { var k, ret=<></>, it = 1; lev = lev || 0; if (typeof min === 'number') { if (typeof max !== 'number') { lev = h; h = arr; arr = max; ...
... else { lev = arr; h = max; arr = min; max = number.positive_infinity; min = 1; } if (h.length === 1) { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(arr[k], it, lev); // need to get it or lev via
arguments[] since our length detection implies no explicit additional params; otherwise define with more than one param (see below) ++it; } } else { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(k, arr[k], it, lev); ...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
} id the name of the non-existent method that was called args an array of the
arguments passed to the method description by default, an attempt to call a method that doesn't exist on an object results in a typeerror being thrown.
...the function takes two
arguments, the first is the name of the method attempted and the second is an array of the
arguments that were passed in the method call.
... the second argument is an actual array (that is, it inherits through the array.prototype chain) and not the array-like
arguments object.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
when a function is called,
arguments are passed to the function as input, and the function can optionally return a value.
...parameter variables are used to import
arguments into functions.
... 528 undefined codingscripting, glossary, javascript, needscontent undefined is a primitive value automatically assigned to variables that have just been declared, or to formal
arguments for which there are no actual
arguments.
JavaScript basics - Learn web development
functions often take
arguments: bits of data they need to do their job.
...
arguments go inside the parentheses, separated by commas if there is more than one argument.
...in the next example, we create a simple function which takes two numbers as
arguments and multiplies them: function multiply(num1,num2) { let result = num1 * num2; return result; } try running this in the console; then test with several
arguments.
Inheritance in JavaScript - Learn web development
inheriting from a constructor with no parameters note that if the constructor you are inheriting from doesn't take its property values from parameters, you don't need to specify them as additional
arguments in call().
... it is good then, that the super() operator also accepts
arguments for the parent constructor.
... looking back to our person constructor, we can see it has the following block of code in its constructor method: constructor(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; } since the super() operator is actually the parent class constructor, passing it the necessary
arguments of the parent class constructor will also initialize the parent class properties in our sub-class, thereby inheriting it: class teacher extends person { constructor(first, last, age, gender, interests, subject, grade) { super(first, last, age, gender, interests); // subject and grade are specific to teacher this.subject = subject; this.grade = grade; } } now when we instantiate teacher ...
Creating a Login Manager storage module
getservice(ci.nsiconsoleservice); return this.__logservice; }, log: function (message) { dump("sampleloginmanager: " + message + "\n"); this._logservice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and
arguments for debugging stub: function(
arguments) { var args = []; for (let i = 0; i <
arguments.length; i++) args.push(
arguments[i]) this.log("called " +
arguments.callee.name + "(" + args.join(",") + ")"); }, init: function slms_init() { this.stub(
arguments); }, initwithfile: function slms_initwithfile(ainputfile, aoutputfile) { this.stub(
arguments); }, addlogin: ...
...function slms_addlogin(login) { this.stub(
arguments); }, removelogin: function slms_removelogin(login) { this.stub(
arguments); }, modifylogin: function slms_modifylogin(oldlogin, newlogin) { this.stub(
arguments); }, getalllogins: function slms_getalllogins(count) { this.stub(
arguments); }, removealllogins: function slms_removealllogins() { this.stub(
arguments); }, getalldisabledhosts: function slms_getalldisabledhosts(count) { this.stub(
arguments); }, getloginsavingenabled: function slms_getloginsavingenabled(hostname) { this.stub(
arguments); }, setloginsavingenabled: function slms_setloginsavingenabled(hostname, enabled) { this.stub(
arguments); }, findlogins: function slms_findlogins(count, hostname, formsubmiturl, httprealm) { th...
...is.stub(
arguments); }, countlogins: function slms_countlogins(ahostname, aformsubmiturl, ahttprealm) { this.stub(
arguments); } }; function nsgetmodule(compmgr, filespec) xpcomutils.generatemodule([sampleloginmanagerstorage]); sample c++ implementation bug 309807 contains a complete example.
Creating Sandboxed HTTP Connections
it takes two
arguments: a listener and a context that is passed to the listener's methods.
... onchannelredirect - when a redirect happens, a new nsichannel is created, and both the old and new ones are passed in as
arguments.
...the observe method gets passed in three
arguments, which for the two cookie topics are: asubject: the channel (nsichannel) that caused this notification to happen.
CustomizableUI.jsm
parameters awidget the object whose property we should use to fetch a localizable string aprop the property on the object to use for the fetching aformatargs (optional) any extra
arguments to use for a formatted string adef (optional) the default to return if we don't find the string in the stringbundle return value the localized string, or adef if the string isn't in the bundle.
... var mywidgetlistener = { onwidgetadded: function(awidgetid, aarea, aposition) { console.log('a widget moved to an area,
arguments:',
arguments); if (awidgetid != 'noida') { return } console.log('my widget moved'); var useicon; if (aarea == customizableui.area_panel) { useicon = 'chrome://branding/content/icon32.png'; } else { useicon = 'chrome://branding/content/icon16.png'; } var...
... myinstances = customizableui.getwidget('noida').instances; for (var i=0; i<myinstances.length; i++) { myinstances[i].node.setattribute('image', useicon); } }, onwidgetdestroyed: function(awidgetid) { console.log('a widget destroyed so removing listener,
arguments:',
arguments); if (awidgetid != 'noida') { return } console.log('my widget destoryed'); customizableui.removelistener(mywidgetlistener); } } customizableui.addlistener(mywidgetlistener); customizableui.createwidget({ id: 'noida', defaultarea: customizableui.area_navbar, label: 'my widget', tooltiptext: 'this is my widget created with cui.jsm' }); it is...
NSPR Error Handling
pr_access_fault_error one of the
arguments of the preceding function specified an invalid memory address.
... pr_illegal_access_error one of the
arguments of the preceding function specified an invalid memory address.
... pr_invalid_argument_error one or more of the
arguments to the function is invalid.
Tutorial: Embedding Rhino
in this document: runscript: a simple embedding entering a context initializing standard objects collecting the
arguments evaluating a script printing the result exiting the context expose java apis using java apis implementing interfaces adding java objects using javascript objects from java using javascript variables calling javascript functions javascript host objects defining host objects counter example counter's constructors class name ...
... collecting the
arguments this code is standard java and not specific to rhino.
... it just collects all the
arguments and concatenates them together.
Hacking Tips
without
arguments, it will dump the bytecode of its caller.
...>u.i.script_->lineno $1 = 1 (gdb) p (*(jsfunction**) 0x7fffffff9848)->u.i.script_->filename $2 = 0xff92d1 "typein" the stack is order as defined in js/src/ion/ionframes-x86-shared.h, it is composed of the return address, a descriptor (a small value), the jsfunction (if it is even) or a jsscript (if the it is odd, remove it to dereference the pointer) and the frame ends with the number of actual
arguments (a small value too).
... gdb has the ability to set breakpoints with commands, but a simpler / friendlier version is to use dprintf, with a location, and followed by printf-like
arguments.
How to embed the JavaScript engine
add two
arguments as integer.
...and say: ok = js_definefunctions(cx, global, my_functions); how to call javascript functions from c first, create
arguments for the call, here i create
arguments with 2 items: // [spidermonkey 24] js::autovaluearray is not defined.
... // js::autovaluevector argv(cx); // argv.resize(2); js::autovaluearray<2> argv(cx); argv[0].setint32(1); argv[1].setint32(2); then call the function: // [spidermonkey 24] pass
arguments length and the 'jsval *' pointer.
JSFastNative
argc unsigned int the number of
arguments supplied to the function by the caller (as opposed to, say, the number of
arguments the function is specified to take in its jsfunctionspec).
... vp jsval * the
arguments, including the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below.
...this points to element 0 of an array of argc jsvals, the
arguments supplied by the caller.
JSNative
argc unsigned the number of
arguments supplied to the function by the caller (as opposed to, say, the number of
arguments the function is specified to take in its jsfunctionspec).
... vp js::value * the
arguments, the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below.
...(this structure is now provided in "js/callargs.h" added in spidermonkey 24 as well as through "jsapi.h".) this structure encapsulates access to the callee function, this, the function call's
arguments, and the eventual return value.
JS_CallFunction
added in spidermonkey 31 argc unsigned number of
arguments you are passing to the function.
...there should be one value for each argument you pass to the function; the number of
arguments you pass may be different from the number of
arguments defined for the function.
... in argc, indicate the number of
arguments passed to the function.
JS_ReportErrorNumber
/ const char16_t ** additional
arguments for the error message.
... these
arguments must be of type char * for js_reporterrornumber or js_reporterrorflagsandnumber, or char16_t * for js_reporterrornumberuc or js_reporterrorflagsandnumberuc.
... the number of additional
arguments required depends on the error message, which is determined by the errorcallback.
JSAPI reference
val_is_boolean obsolete since jsapi 32 jsval_is_number obsolete since jsapi 32 jsval_is_int obsolete since jsapi 32 jsval_is_double obsolete since jsapi 32 jsval_is_string obsolete since jsapi 32 jsval_is_object obsolete since jsapi 15 jsval_is_primitive obsolete since jsapi 32 jsval_is_gcthing obsolete since jsapi 32 high-level type-conversion routines for packing and unpacking function
arguments.
... js_convert
arguments obsolete since jsapi 38 js_convert
argumentsva obsolete since jsapi 38 js_push
arguments obsolete since javascript 1.8.5 js_push
argumentsva obsolete since javascript 1.8.5 js_pop
arguments obsolete since javascript 1.8.5 js_addargumentformatter obsolete since jsapi 18 js_removeargumentformatter obsolete since jsapi 18 the following functions convert js values to various types.
...olete since jsapi 13 objects typedef jsobject js_defineobject js_newobject js_newplainobject added in spidermonkey 38 js_newobjectforconstructor added in spidermonkey 1.8.5 js_newglobalobject added in spidermonkey 1.8 js_newobjectwithgivenproto js_new added in spidermonkey 1.8 js_isglobalobject added in jsapi 24 js_constructobject obsolete since jsapi 16 js_constructobjectwith
arguments obsolete since jsapi 16 js_getclass js_getobjectprototype added in jsapi 17 js_getfunctionprototype added in spidermonkey 17 js_getarrayprototype added in spidermonkey 24 js_getconstructor js_getglobalforobject js_getinstanceprivate js_getprototype js_setprototype js_getprivate js_setprivate js_freezeobject added in spidermonkey 1.8.5 js_deepfreezeobject added in spidermonkey 1.8.
Mozilla internal string guide
bulkwrite() takes four
arguments: the new capacity (which may be rounded up), the number of code units at the beginning of the string to preserve (typically the old logical length), a boolean indicating whether reallocating a smaller buffer is ok if the requested capacity would fit in a buffer that's smaller than current one, and a reference to an nsresult for indicating failure on oom.
...it takes three
arguments that match the first three
arguments of bulkwrite().
...it takes two
arguments: the new logical length of the string (which must not exceed the capacity retuned by the length() method of the handle) and a boolean indicating whether it's ok to attempt to reallocate a smaller buffer in case a smaller mozjemalloc bucket could accommodate the new logical length.
nsIWebBrowserPersist
exceptions thrown ns_error_invalid_arg one or more
arguments was invalid.
... exceptions thrown ns_error_invalid_arg one or more
arguments was invalid.
...all
arguments and exceptions are identical to saveuri, with the exception of aisprivate which is used to indicate the private nature of the operation.
XPIDL
if optional_argc is present, then an additional uint8_t _argc method is added at the end which receives the number of optional
arguments that were actually used (obviously, you need to have an optional argument in the first place).
...finally, as an exception to everything already mentioned, for attribute getters and setters the jscontext *cx comes before any other
arguments.
... common changes to an interface, such as changes to a method signature, number of
arguments, and number or type of attributes, automatically require an iid change.
Using Objective-C from js-ctypes
typedef struct objc_object *id; in this example, we send an alloc message without any
arguments using the following code.
... id nsspeechsynthesizer = (id)objc_getclass("nsspeechsynthesizer"); id tmp = objc_msgsend(nsspeechsynthesizer, alloc); selector for a method with
arguments in this case, [nsspeechsynthesizer initwithvoice:] takes one argument; the selector name with a trailing colon.
... sel initwithvoice = sel_registername("initwithvoice:"); if a method takes two or more
arguments, the selector name becomes a concatenation of each name.
Standard OS Libraries
you just need to supply the path to appropriate files and set up the proper types of values/
arguments in the js-ctypes code.
... this article allows you to find out what types to give to values/
arguments by supplying links to the documentation of the os libraries.
...for finding out the values and types of
arguments and returns of the functions you want to use from this api, you must visit the functions page on this linked msdn site; it will give you all that information.
Web Console remoting - Firefox Developer Tools
for each console message we receive in the server, we send the following consoleapicall packet to the client: { "from": "conn0.console9", "type": "consoleapicall", "message": { "level": "error", "filename": "http://localhost/~mihai/mozilla/test.html", "linenumber": 149, "functionname": "", "timestamp": 1347302713771, "private": false, "
arguments": [ "error omg aloha ", { "type": "object", "classname": "htmlbodyelement", "actor": "conn0.consoleobj20" }, " 960 739 3.141592653589793 %a", "zuzu", { "type": "null" }, { "type": "undefined" } ] } } similar to how we send the page errors, here we send the actual console event received from the nsiobserverservice.
... we change the
arguments array - we create objectactor instances for each object passed as an argument - and, lastly, we remove some unneeded properties (like window ids).
...the web console can then inspect the
arguments.
Transformations - Web APIs
transform(a, b, c, d, e, f) multiplies the current transformation matrix with the matrix described by its
arguments.
... the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] if any of the
arguments are infinity the transformation matrix must be marked as infinite instead of the method throwing an exception.
... settransform(a, b, c, d, e, f) resets the current transform to the identity matrix, and then invokes the transform() method with the same
arguments.
ChildNode.after() - Web APIs
code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(
arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
...ring(argitem))); }); this.parentnode.insertbefore(docfrag, this.nextsibling); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); another polyfill // from: https://github.com/fabiovergani/js-polyfill_element.prototype.after/blob/master/after.js (function(x){ var o=x.prototype,p='after'; if(!o[p]){ o[p]=function(){ var e, m=
arguments, l=m.length, i=0, t=this, p=t.parentnode, n=node, s=string, d=document; if(p!==null){ while(i<l){ e=m[i]; if(e instanceof n){ t=t.nextsibling; if(t!==null){ p.insertbefore(e,t); }else{ p.appendchild(e); }; }else{ p.appendchild(d.createtextnode(s(e))); }; ...
... ++i; }; }; }; }; })(element); /* minified: (function(x){ var o=x.prototype; o.after||(o.after=function(){var e,m=
arguments,l=m.length,i=0,t=this,p=t.parentnode,n=node,s=string,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextsibling )!==null)?p.insertbefore(e,t):p.appendchild(e)):p.appendchild(d.createtextnode(s(e)));++i;}}}); }(element)); */ specification specification status comment domthe definition of 'childnode.after()' in that specification.
GlobalEventHandlers.onerror - Web APIs
syntax for historical reasons, different
arguments are passed to window.onerror and element.onerror handlers (as well as on error-type window.addeventlistener handlers).
...pt error: see browser console for detail'); } else { var message = [ 'message: ' + msg, 'url: ' + url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; when using the inline html markup (<body onerror="alert('an error occurred')">), the html specification requires
arguments passed to onerror to be named event, source, lineno, colno, error.
... in browsers that have not implemented this requirement, they can still be obtained via
arguments[0] through
arguments[2].
Drag Operations - Web APIs
it takes two
arguments: the type of data and the data value.
... event.datatransfer.setdragimage(image, xoffset, yoffset); three
arguments are necessary.
...the second and third
arguments to the setdragimage() method are offsets where the image should appear relative to the mouse pointer.
Window.showModalDialog() - Web APIs
syntax returnval = window.showmodaldialog(uri[,
arguments][, options]); returnval holds the returnvalue property as set by the document specified by uri.
...
arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialog
arguments property.
... note: firefox does not implement the dialoghide, edge, status, or unadorned
arguments.
Concurrency model and the event loop - JavaScript
function foo(b) { let a = 10 return a + b + 11 } function bar(x) { let y = 3 return foo(x * y) } console.log(bar(7)) //returns 42 when calling bar, a first frame is created containing bar's
arguments and local variables.
... when bar calls foo, a second frame is created and pushed on top of the first one containing foo's
arguments and local variables.
... the function settimeout is called with 2
arguments: a message to add to the queue, and a time value (optional; defaults to 0).
Deprecated and obsolete features - JavaScript
function properties the caller and
arguments properties are deprecated, because they leak the function caller.
... instead of the
arguments property, you should use the
arguments object inside function closures.
... function property description arity number of formal
arguments.
JavaScript error reference - JavaScript
ay 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" before initializationreferenceerror: deprecated caller or
arguments usagereferenceerror: invalid assignment left-hand sidereferenceerror: reference to undefined property "x"syntaxerror: "0"-prefixed octal literals and octal escape seq.
... of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a functiontypeerror: "x" is not a non-null objecttypeerror: "x" is read-onlytypeerror: 'x' is not iterabletypeerror: more
arguments neededtypeerror: reduce of empty array with no initial valuetypeerror: x.prototype.y called on incompatible typetypeerror: can't access dead objecttypeerror: can't access property "x" of "y"typeerror: can't assign to property "x" on "y": not an objecttypeerror: can't define property "x": "obj" is not extensibletypeerror: can't delete non-configurable array elementtypeerror: can't redefine non-con...
...figurable property "x"typeerror: cannot use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid
argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning:...
Array.prototype.concat() - JavaScript
it does not recurse into nested array
arguments.
... the concat method does not alter this or any of the arrays provided as
arguments but instead returns a shallow copy that contains copies of the same elements combined from the original arrays.
...this includes elements of array
arguments that are also arrays.
Array.prototype.every() - JavaScript
syntax arr.every(callback(element[, index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three
arguments: element the current element being processed in the array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the array object being traversed.
... if (
arguments.length > 1) { t = thisarg; } // 6.
Array.prototype.findIndex() - JavaScript
it takes three
arguments: element the current element being processed in the array.
... callback is invoked with three
arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is passed to findindex(), it will be used as the this inside each invocation of the callback.
... var thisarg =
arguments[1]; // 5.
Array.of() - JavaScript
the array.of() method creates a new array instance from a variable number of
arguments, regardless of number or type of the
arguments.
... the difference between array.of() and the array constructor is in the handling of integer
arguments: array.of(7) creates an array with a single element, 7, whereas array(7) creates an empty array with a length property of 7 (note: this implies an array of 7 empty slots, not slots with actual undefined values).
... if (!array.of) { array.of = function() { return array.prototype.slice.call(
arguments); // or let vals = []; for(let prop in
arguments){ vals.push(
arguments[prop]); } return vals; } } examples using array.of array.of(1); // [1] array.of(1, 2, 3); // [1, 2, 3] array.of(undefined); // [undefined] specifications specification ecmascript (ecma-262)the definition of 'array.of' in that specification.
Array.prototype.slice() - JavaScript
the
arguments inside a function is an example of an 'array-like object'.
... function list() { return array.prototype.slice.call(
arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.prototype and it can also be reduced using [].slice.call(
arguments) instead of array.prototype.slice.call.
... let unboundslice = array.prototype.slice let slice = function.prototype.call.bind(unboundslice) function list() { return slice(
arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.slice' in that specification.
Error.prototype.stack - JavaScript
the non-standard stack property of error objects offer a trace of which functions were called, in what order, from which line and file, and with what
arguments.
...while an object (or array, etc.) would appear in the converted form "[object object]", and as such could not be evaluated back into the actual objects, scalar values could be retrieved (though it may be — it is still possible in firefox 14 — easier to use
arguments.callee.caller.
arguments, as could the function name be retrieved by
arguments.callee.caller.name).
...note that if string
arguments were passed in with values such as "@", "(", ")" (or if in file names), you could not easily rely on these for breaking the line into its component parts.
Function() constructor - JavaScript
all
arguments passed to the function are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed.
... examples specifying
arguments with the function constructor the following code creates a function object that takes two
arguments.
... // example can be run directly in your javascript console // create a function that takes two
arguments, and returns the sum of those
arguments const adder = new function('a', 'b', 'return a + b'); // call the function adder(2, 6); // 8 the
arguments "a" and "b" are formal argument names that are used in the function body, "return a + b".
Math.max() - JavaScript
if at least one of the
arguments cannot be converted to a number, nan is returned.
... -infinity is the initial comparant because almost every other value is bigger, that's why when no
arguments are given, -infinity is returned.
... if at least one of
arguments cannot be converted to a number, the result is nan.
handler.apply() - JavaScript
syntax const p = new proxy(target, { apply: function(target, thisarg,
argumentslist) { } }); parameters the following parameters are passed to the apply() method.
...
argumentslist the list of
arguments for the call.
... const p = new proxy(function() {}, { apply: function(target, thisarg,
argumentslist) { console.log('called: ' +
argumentslist.join(', ')); return
argumentslist[0] +
argumentslist[1] +
argumentslist[2]; } }); console.log(p(1, 2, 3)); // "called: 1, 2, 3" // 6 specifications specification ecmascript (ecma-262)the definition of '[[call]]' in that specification.
Reflect - JavaScript
static methods reflect.apply(target, thisargument,
argumentslist) calls a target function with
arguments as specified by the
argumentslist parameter.
... reflect.construct(target,
argumentslist[, newtarget]) the new operator as a function.
... equivalent to calling new target(...
argumentslist).
Set.prototype.forEach() - JavaScript
syntax myset.foreach(callback[, thisarg]) parameters callback function to execute for each element, taking three
arguments: currentvalue, currentkey the current element being processed in the set.
... as there are no keys in set, the value is passed for both
arguments.
... callback is invoked with three
arguments: the element value the element key the set object being traversed there are no keys in set objects, however, so the first two
arguments are both values contained in the set.
String.prototype.concat() - JavaScript
the concat() method concatenates the string
arguments to the calling string and returns a new string.
... description the concat() function concatenates the string
arguments to the calling string and returns a new string.
... if the
arguments are not of the type string, they are converted to string values before concatenating.
String.prototype.replace() - JavaScript
the
arguments supplied to this function are described in the "specifying a function as a parameter" section below.
... the
arguments to the function are as follows: possible name supplied value match the matched substring.
... (the exact number of
arguments depends on whether the first argument is a regexp object—and, if so, how many parenthesized submatches it specifies.) the following example will set newstring to 'abc - 12345 - #$*%': function replacer(match, p1, p2, p3, offset, string) { // p1 is nondigits, p2 digits, and p3 non-alphanumerics return [p1, p2, p3].join(' - '); } let newstring = 'abc12345#$*%'.replace(/([^\d]*)(\d*)([^\w]*)...
String.prototype.replaceAll() - JavaScript
the
arguments supplied to this function are described in the "specifying a function as a parameter" section below.
... the
arguments to the function are as follows: possible name supplied value match the matched substring.
... (the exact number of
arguments depends on whether the first argument is a regexp object—and, if so, how many parenthesized submatches it specifies.) examples using replaceall 'aabbcc'.replaceall('b', '.'); // 'aa..cc' non-global regex throws when using a regular expression search value, it must be global.
concat - XPath
syntax concat(string1 ,string2 [,stringn]* )
arguments stringn this function accepts two or more
arguments.
... each of these
arguments is a string.
... returns a single string that is the concatenation of all the strings passed to the function as
arguments.
Interacting with page scripts - Archive of obsolete content
exported function when the user pushes the button: <html> <head> </head> <body> <input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.greetme("page script")); }, false); </script> </body> </html> exportfunction() works by structured cloning the
arguments and return value of the function from one scope to the other.
... since structured cloning doesn't work for functions, this means that you can't export functions that take functions as
arguments (such as callbacks) or functions that return functions.
context-menu - Archive of obsolete content
arguments value : listeners are passed a single argument which is the message posted from the content script.
...
arguments value : listeners are passed a single argument which is the message posted from the content script.
page-mod - Archive of obsolete content
arguments worker : the listener function is passed a worker object that can be used to communicate with any content scripts attached to this document.
...
arguments error : listeners are passed a single argument, the error object.
page-worker - Archive of obsolete content
arguments value : listeners are passed a single argument which is the message posted from the content script.
...
arguments error : listeners are passed a single argument, the error object.
panel - Archive of obsolete content
arguments value : listeners are passed a single argument which is the message posted from the content script.
...
arguments error : listeners are passed a single argument, the error object.
/loader - Archive of obsolete content
[ '', 'resource:///modules/' ] ]; resolveuri('./main', mapping); // => resource://my-addon/main.js resolveuri('devtools/gcli', mapping); // => resource:///modules/devtools/gcli.js resolveuri('sdk/core/promise', mapping); // => resource://gre/modules/commonjs/sdk/core/promise.js override() this function is used to create a fresh object that contains own properties of two
arguments it takes.
... if
arguments have properties with conflicting names the property from the second argument overrides that from the first.
content/worker - Archive of obsolete content
arguments value : the event listener is passed the message, which must be a json-serializable value.
...
arguments error : the event listener is passed a single argument which is an error object.
event/core - Archive of obsolete content
emit(target, type, message,
arguments) execute each of the listeners in order with the supplied
arguments.
...
arguments : object|number|string|boolean more
arguments that will be passed to listeners.
event/target - Archive of obsolete content
instantiation it's easy to create event target objects, no special
arguments are required.
... const { eventtarget } = require("sdk/event/target"); let target = eventtarget(); for a convenience though optional options
arguments may be used, in which case all the function properties with keys like: onmessage, onmyevent...
test/utils - Archive of obsolete content
it has two
arguments, or three if it is asynchronous: the first argument is the test's name as a string.
...it has two
arguments, or three if it is asynchronous: the first argument is the test's name as a string.
window/utils - Archive of obsolete content
var { open } = require('sdk/window/utils'); var window = open('data:text/html,hello window', { name: 'jetpack window', features: { width: 200, height: 50, popup: true } }); args object extra argument(s) to be attached to the new window as the window.
arguments property.
... args object extra argument(s) to be attached to the new window as the window.
arguments property.
Listening for Load and Unload - Archive of obsolete content
if your add-on exports a function called main(), then that function will be called whenever the add-on is loaded, and it will be passed an object containing a string describing the reason it was loaded as well as any
arguments passed to it.
...it will be loaded in the same circumstances, but you won't get access to the load/unload reason or
arguments.
Canvas code snippets - Archive of obsolete content
]; var props = ['canvas', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'strokestyle', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx,
arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.prototype[method] = function() { return this.ctx[method].apply(this.ctx,
arguments); }; } for (let p of props) { let prop = p; canvas2dcontext.prototype[prop] = function(value) { if (value === undefined) return this.ctx[prop]; this.ctx[prop] = value;...
... return this; }; } }; var canvas = document.getelementbyid('canvas'); // use context to get access to underlying context var ctx = canvas2dcontext(canvas) .strokestyle('rgb(30, 110, 210)') .transform(10, 3, 4, 5, 1, 0) .strokerect(2, 10, 15, 20) .context; // use property name as a function (but without
arguments) to get the value var strokestyle = canvas2dcontext(canvas) .strokestyle('rgb(50, 110, 210)') .strokestyle(); code usable only from privileged code these snippets are only useful from privileged code, such as extensions or privileged apps.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
if (array.isarray(elemnameorarray)) { var frag = doc.createdocumentfragment(); array.foreach(
arguments, function(thiselem) { frag.appendchild(tag.apply(null, thiselem)); }); return frag; } // single element?
...they're not in any namespace) elem.setattributens(attrns.namespace || "", attrns.shortname, val); } } // create and append this element's children var childelems = array.slice(
arguments, 2); childelems.foreach(function(childelem) { if (childelem != null) { elem.appendchild( childelem instanceof doc.defaultview.node ?
Install.js - Archive of obsolete content
['classic', 'modern'] extpostinstallmessage: null, // set to null for no post-install message // --- editable items end --- profileinstall: true, silentinstall: false, install: function() { var jarname = this.extshortname + '.jar'; var profiledir = install.getfolder('profile', 'chrome'); // parse http
arguments this.parse
arguments(); // check if extension is already installed in profile if (file.exists(install.getfolder(profiledir, jarname))) { if (!this.silentinstall) { install.alert('updating existing profile install of ' + this.extfullname + ' to version ' + this.extversion + '.'); } this.profileinstall = true; } else if (!this.silentinstall) { // ask user for inst...
...name + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handleerror(err); return; } }, parse
arguments: function() { // can't use string handling in install, so use if statement instead var args = install.
arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall = true; this.silentinstall = true; } }, handleerror: function(err) { if (!this.silentinstall) { install.alert('error: co...
JXON - Archive of obsolete content
*/ /* element.prototype.appendjxon = function (oobjtree) { loadobjtree(document, this, oobjtree); return this; }; */ this.build = function (oxmlparent, nverbosity /* optional */, bfreeze /* optional */, bnesteattributes /* optional */) { const nverbmask =
arguments.length > 1 && typeof nverbosity === "number" ?
... nverbosity & 3 : /* put here the default verbosity level: */ 1; return createobjtree(oxmlparent, nverbmask, bfreeze || false,
arguments.length > 3 ?
Java in Firefox Extensions - Archive of obsolete content
org.mozilla.developer.helloworld", true, cl); var astaticmethod = aclass.getmethod("getgreeting", []); var greeting = astaticmethod.invoke(null, []); alert(greeting); another, perhaps simpler approach is as follows: var myclass = loader.loadclass('com.example.myclass'); // use the same loader from above var myobj = myclass.newinstance(); var binval = myobj.mymethod(arg1, arg2); // pass whatever
arguments you need (they'll be auto-converted to java form, taking into account the liveconnect conversion rules) for more complex cases, in which you need to call a specific constructor with
arguments, you will need reflection.
...a.lang.class, 2); // 2nd argument should indicate the number of items in following array paramtypes[0] = java.io.file; var envconfigclass = loader.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] = envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific
arguments we wish to pass to it var arglist = reflect.array.newinstance(java.lang.object, 2); // 2nd argument should indicate the number of items in the following array var mydir = new java.io.file(dirurl); // a file url arglist[0] = mydir; var envconfig = envconfigclass.newinstance(); arglist[1] = envconfig; // call our constructor with our
arguments var env = constructor.newinstance(arglist); be aware t...
Running Tamarin performance tests - Archive of obsolete content
rebuild of test files --vmargs args to pass to vm --timeout max time to run all tests --testtimeout max time to let a test run, in sec (default -1 = never timeout) --html also create an html output file --notimecheck do not recompile .abc if timestamp is older than .as --java location of java executable (default=java) --javaargs
arguments to pass to java --random run tests in random order --seed explicitly specify random seed for --random -s --avm2 second avmplus command to use --avmname nickname for avm to use as column header --avm2name nickname for avm2 to use as column header --detail display results in 'old-style' format --raw output all raw test val...
... --aotargs any extra
arguments to pass to compile.py.
Venkman Introduction - Archive of obsolete content
the scope object holds all
arguments and local variables, and the this object holds the value of the this keyword.
... if you don't provide
arguments to the /break command, all breakpoints are listed in the interactive session view.
Moving, Copying and Deleting Files - Archive of obsolete content
this method takes two
arguments, the first is the destination directory in which to copy the file to, and the second argument is the new name of the file, if you wish to rename it in its new location.
...as with nsifile.copyto(), nsifile.moveto() takes two
arguments, the destination directory and the new filename.
openPopup - Archive of obsolete content
x, y for an anchored popup, the x and y
arguments may be used to offset the popup from its anchored position by some number, measured in css pixels.
...in this case, the position and attributesoverride
arguments are ignored.
Tree Widget Changes - Archive of obsolete content
the tree and view methods no longer take ids as
arguments when columns are used.
...for example, nsitreeview.getcellvalue() takes a row index and a nsitreecolumn as
arguments, whereas before it took a row index and a column id.
Creating an Installer - Archive of obsolete content
this function takes two
arguments, the first is a list of packages to install, and the second is a callback function which will be called when the installation is complete.
...this function has two
arguments.
Manipulating Lists - Archive of obsolete content
here is an example: example 1 : source view <script> function additem(){ document.getelementbyid('thelist').appenditem("thursday", "thu"); } </script> <listbox id="thelist"/> <button label="add" oncommand="additem();"/> the appenditem() takes two
arguments, the label, in this case 'thursday', and a value 'thu'.
... the two
arguments correspond to the label attribute and the value attribute on the listitem element.
Open and Save Dialogs - Archive of obsolete content
this function takes three
arguments, the window that is opening the dialog, the title of the dialog and the mode.
...it takes no
arguments but returns a status code that indicates what the user selected.
panel - Archive of obsolete content
x, y for an anchored popup, the x and y
arguments may be used to offset the popup from its anchored position by some number, measured in css pixels.
...in this case, the position and attributesoverride
arguments are ignored.
prefwindow - Archive of obsolete content
the
arguments are similar to the window's opendialog method except that the window name does not need to be supplied.
... initwithparams(window.
arguments[0]); // we expect a single parameter to be passed to the window } function initwithparams(aparams) { // this will also get called when an already open window is activated using openwindow() } closing a prefwindow sometimes you need to do things when the prefwindow is closed, such as things that can't (or shouldn't) be handled as preferences, such as saving passwords or updating sqlite data.
NPP_New - Archive of obsolete content
argc number of html
arguments in the embed tag for an embedded plug-in; determines the number of attributes in the argn and argv arrays.
...it is called after np_initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, information about html embed
arguments.
New in JavaScript 1.8.5 - Archive of obsolete content
function.prototype.bind() creates a new function that, when called, itself calls this function in the context provided (with a given sequence of
arguments).
...bug 520696 function.apply() can accept any array-like object as the
arguments list, instead of only true arrays.
2D maze game with device orientation - Game development
var game = new phaser.game(320, 480, phaser.canvas, 'game'); the line above will initialize the phaser instance — the
arguments are the width of the canvas, height of the canvas, rendering method (we're using canvas, but there are also webgl and auto options available) and the optional id of the dom container we want to put the canvas in.
....anchor.set(0.5,0); this.startbutton = this.add.button(ball._width*0.5, 200, 'button-start', this.startgame, this, 2, 0, 1); this.startbutton.anchor.set(0.5,0); this.startbutton.input.usehandcursor = true; }, startgame: function() { this.game.state.start('howto'); } }; to create a new button there's add.button method with the following list of optional
arguments: top absolute position on canvas in pixels.
Graceful asynchronous programming with Promises - Learn web development
you could even do this, since the functions just pass their
arguments directly, so there isn't any need for that extra layer of functions: choosetoppings().then(placeorder).then(collectorder).then(eatpizza).catch(failurecallback); this is not quite as easy to read, however, and this syntax might not be usable if your blocks are more complex than what we've shown here.
...) { return new promise((resolve, reject) => { if (message === '' || typeof message !== 'string') { reject('message is empty or not a string'); } else if (interval < 0 || typeof interval !== 'number') { reject('interval is negative or not a number'); } else { settimeout(function(){ resolve(message); }, interval); } }); }; here we are passing two
arguments into a custom function — a message to do something with, and the time interval to pass before doing the thing.
A first splash into JavaScript - Learn web development
this is a method that takes two input values (called
arguments) — the type of event we are listening out for (in this case click) as a string, and the code we want to run when the event occurs (in this case the checkguess() function).
...a for loop takes three input values (
arguments): a starting value: in this case we are starting a count at 1, but this could be any number you like.
Debugging on Windows
"program
arguments:" should show the options.
... in vc 7 and 8 this option is called project > properties > debugging > command
arguments.
HTTP logging
start logging using command line
arguments since firefox 61 it's possible to start logging in a bit simpler way than setting environment variables: using command line
arguments.
... here is an example for the windows platform, on other platforms we accept the same form of the
arguments: if firefox is already running, exit out of it.
Eclipse CDT
select the
arguments tab and enter any args you want to pass to firefox (such as "--no-remote -p my-testing-profile").
...this library could then check whether the process is a compiler instance and, if so, use the processes' current working directory and the
arguments that were passed to it to reliably obtain the information it needs for each source file that is compiled.
Communicating with frame scripts
chrome code and frame scripts communicate back and forth using a messaging api which can include json-serializable objects as
arguments.
...yncmessage() is an array of all the values returned from every listener, even if it only contains a single value: // frame script addeventlistener("click", function (event) { var results = sendsyncmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }); content.console.log(results[0]); // "value from chrome" }, false); like
arguments, return values from sendsyncmessage() must be json-serializable, so chrome can't return functions.
AsyncShutdown.jsm
void addblocker( in string name, in function|promise|* condition, optional in function info )
arguments name the human-readable name of the blocker.
... boolean removeblocker( in function|promise|* condition )
arguments condition a condition blocking the completion of the phase.
JNI.jsm
hod overview cdata getforthread(); cdata loadclass(cdata ajenv, string aclassfullyqualifiedname, [optional] object adeclares); cdata newstring(cdata ajenv, string astr); string readstring(cdata ajenv, cdata ajavastring); void unloadclasses(); methods getforthread() blah blah cdata getforthread(); parameters this function does not take any
arguments.
... unloadclasses() blah blah void unloadclasses(); parameters this function takes no
arguments.
NSS_3.12_release_notes.html
bug 407866: contributed improvement to security/nss/lib/freebl/mpi/mp_comba.c bug 410587: ssl_getchannelinfo returns secsuccess on invalid
arguments bug 416508: fix a _msc_ver typo in sha512.c, and use sec_begin_protos/sec_end_protos in secport.h bug 419242: 'all' is not the default makefile target in lib/softoken and lib/softoken/legacydb bug 419523: export cert_newtempcertificate.
...bug 330721: remove os/2 vacpp compiler support from nss bug 408260: certutil usage doesn't give enough information about trust
arguments bug 410226: leak in create_objects_from_handles bug 415007: pk11_findcertfromdersubjectandnickname is dead code bug 416267: compiler warnings on solaris due to extra semicolon in sec_asn1_mksub bug 419763: logger thread should be joined on exit bug 424471: counter overflow in bltest bug 229335: remove certificates that expired in august 2004 from tree bug 346551: init secitem dertemp in crmf_enco...
NSS Sample Code Sample_1_Hashing
stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* * check for the missing
arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
...progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hash...
Hashing - sample 1
stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* * check for the missing
arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* * digests a file according to the specified algorithm.
...progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hash...
sample1
or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* check for the missing
arguments */ static void printmsgandexit(const char *progname, char opt) { fprintf(stderr, "%s: option -%c requires an argument\n", progname, opt); usage(progname); } #define require_arg(opt,value) if (!(value)) printmsgandexit(progname, opt) /* digests a file according to the specified algorithm.
...progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and valida...
NSS tools : pk12util
options and
arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database.
...
arguments -c keycipher specify the key encryption algorithm.
NSS tools : pk12util
options and
arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database.
...
arguments -n certname specify the nickname of the cert and private key to export.
NSS tools : signtool
-f commandfile specifies a text file containing netscape signing tool options and
arguments in keyword=value format.
... all options and
arguments can be expressed through this file.
Rhino optimization
arguments are passed as object/number pairs to reduce conversion overhead.
... note some language features (indirect calls to eval, use of the
arguments property of function objects) were previously not supported in higher optimization levels.
Scripting Java
if we just view the method object by itself we can see the various overloaded forms of the method: js> f.listfiles function listfiles() {/* java.io.file[] listfiles() java.io.file[] listfiles(java.io.filenamefilter) java.io.file[] listfiles(java.io.filefilter) */} this output shows that the file class defines three overloaded methods listfiles: one that takes no
arguments, another with a filenamefilter argument, and a third with a filefilter argument.
... js> f.name test.txt js> f.directory false calling overloaded methods the process of choosing a method to call based upon the types of the
arguments is called overload resolution.
SpiderMonkey Internals
some spidermonkey bytecode operations have many special cases, depending on the type of their
arguments.
...this bug doesn't affect spidermonkey, because it uses its own js_dtoa() call in jsnum.cpp to convert from double to string, but it's a bug that we'll fix later, and one you should be aware of if you intend to use a js_*printf() function with your own floating type
arguments - various vendor sprintf's mishandle nan, +/-inf, and some even print normal floating values inaccurately.
JS_DefineFunction
nargs unsigned number of
arguments that are passed to the function when it is called.
...nargs indicates the number of
arguments the function expects to receive.
JS_GetFunctionArity
get the number of
arguments a function expects.
... note that it is not an error per se to call a javascript function with more or fewer actual
arguments than its arity.
JS_GetProperty
then the jsclass.getproperty hook of obj's class is called with the
arguments (cx, obj, id, vp).
...otherwise *vp is set to the property's stored value, or undefined if the property does not have a stored value, and then the property's getter is called with the
arguments (cx, obj, id, vp).
JS_InstanceOf
args js::callargs * optional pointer to
arguments.
...to use it this way, pass the
arguments provided by the engine for args with js::callargsfromvp(argc, vp).
JS_NewFunction
nargs unsigned number of
arguments the function expects.
...nargs is the number of
arguments the function expects.
JS_SET_TRACING_DETAILS
when printer is not null, the arg and index
arguments are available to the callback as the debugprinterarg and debugprintindex fields of trc.
... the storage for name or callback's
arguments needs to live only until the following call to js_calltracer returns.
JS_SetProperty
after the new property is added, the jsclass.addproperty hook is called with the
arguments (cx, obj, id, &v).
...if the property has a javascript setter, it is called; otherwise, if it has a javascript getter, then an error is reported; otherwise the property's setter is called, passing the
arguments (cx, obj, id, &v).
Parser API
interface newexpression <: expression { type: "newexpression"; callee: expression;
arguments: [ expression ]; } a new expression.
... interface callexpression <: expression { type: "callexpression"; callee: expression;
arguments: [ expression ]; } a function or method call expression.
SpiderMonkey 1.8.8
deleted apis js_get_class (use js_getclass instead) js_constructobject and js_constructobjectwith
arguments (preferably use js_new instead, or use this reimplementation as a short-term fix) js_newcompartmentandglobalobject (use js_newglobalobject instead.) jspd_argument jsval_is_object() (use !jsval_is_primitive(v) to detect objects and jsval_is_null(v) to detect null).
...jsclass callback changes many of the jsclass callbacks such as jsresolveop, jsenumerateop and jspropertyop, have a type change on their
arguments to jshandleobject, jshandleid, jshandlemutableobject etc.
SpiderMonkey 17
deleted apis js_get_class (use js_getclass instead) js_constructobject and js_constructobjectwith
arguments (preferably use js_new instead, or use this reimplementation as a short-term fix) js_newcompartmentandglobalobject (use js_newglobalobject instead.) jspd_argument jsval_is_object() (use !jsval_is_primitive(v) to detect objects and jsval_is_null(v) to detect null).
...jsclass callback changes many of the jsclass callbacks such as jsresolveop, jsenumerateop and jspropertyop, have a type change on their
arguments to jshandleobject, jshandleid, jshandlemutableobject etc.
The Publicity Stream API
onsuccess is a callback that will be invoked with no
arguments if the activity is successfully posted.
...missing required properties) finally, the publicizeactivity() function will throw an exception if required
arguments are missing, or if unsupported
arguments are present.
Creating the Component Code
without any
arguments passed to regxpcom, the program registers the component in the default component registry.
...uuidgen is a command-line tool that returns a unique 128-bit number when you call it with no
arguments: $ uuidgen ce32e3ff-36f8-425f-94be-d85b26e634ee on windows, a program called guidgen.exe does the same thing and also provides a graphical user interface if you'd rather point and click.
How To Pass an XPCOM Object to a New Window
a more useful example is available in the source code: toolkit/components/help/content/contexthelp.js#61 if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the
arguments to the window creation method.
...to access the xpcom object from the window's code, you can access the window.
arguments[] array, as shown in the example below: components.utils.reporterror(string(window.
arguments[0])); this will produce output similar to "[xpconnect wrapped nsimyxpcomobject]".
nsIAppShellService
doprofilestartup() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) starts up the profile manager with the given
arguments.
... void doprofilestartup( in nsicmdlineservice acmdlineservice, in boolean caninteract ); parameters acmdlineservice the
arguments given to the program.
nsIAppStartup
doprofilestartup() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) starts up the profile manager with the given
arguments.
... void doprofilestartup( in nsicmdlineservice acmdlineservice, in boolean caninteract ); parameters acmdlineservice the
arguments given to the program.
nsICommandLineHandler
toolkit/components/commandlines/public/nsicommandlinehandler.idlscriptable handles
arguments on the command line of a xul application.
...if this handler finds
arguments that it understands, it should perform the appropriate actions (such as opening a window), and remove the
arguments from the command-line array.
nsICommandLineRunner
void init( in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state ); parameters argc the number of
arguments being passed.
... argv an array storing pointers to the
arguments workingdir directory where the command will run.
nsIProcess2
void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of
arguments to pass into the process, using the native character set.
... count the number of
arguments passed in the args array.
nsIStringBundleService
formatstatusmessage() formats a message string from a status code and status
arguments.
...multiple
arguments can be separated by newline ('\n') characters.
nsIWebBrowser
ns_error_invalid_arg one of the
arguments was invalid or the object did not implement the interface specified by the iid.
... ns_error_invalid_arg one of the
arguments was invalid or the object did not implement the interface specified by the iid.
Creating a gloda message query
you can find the file, which includes doxygen markup of sorts, here: https://hg.mozilla.org/comm-central/file/tip/mailnews/db/gloda/modules/gloda.js components.utils.import("resource:///modules/gloda/public.js"); create the query let query = gloda.newquery(gloda.noun_message); add constraints to the query each constraint function takes one or more
arguments which are "or"ed together.
...in theory, providing no
arguments should result in finding messages with any attachment, but this is somewhat untested.
js-ctypes reference
first, they provide a concrete representation of different data types, allowing the programmer to describe the
arguments and return type of a native function (see library.declare()).
...you declare the
arguments and return value of a native function with ctype objects.
Initialization and Destruction - Plugins
the argc parameter is the number of html
arguments in the element.
... the
arguments in the embed element are name-value pairs made up of the attribute name (for example, align) and its value (for example, top).
Debugger.Frame - Firefox Developer Tools
arguments the
arguments passed to the current frame, or null if this is not a "call" frame.
...if it is a function, spidermonkey calls it when execution in this frame makes a small amount of progress, passing no
arguments and providing this debugger.frame instance as the thisvalue.
Beacon API - Web APIs
the method takes two
arguments, the url and the data to send in the request.
...the method takes two
arguments, the url and the data to send in the request.
CanvasRenderingContext2D - Web APIs
canvasrenderingcontext2d.transform() multiplies the current transformation matrix with the matrix described by its
arguments.
... canvasrenderingcontext2d.settransform() resets the current transform to the identity matrix, and then invokes the transform() method with the same
arguments.
ChildNode.replaceWith() - Web APIs
with(node) { replacewith("foo"); } // referenceerror: replacewith is not defined polyfill you can polyfill the replacewith() method in internet explorer 10+ and higher with the following code: function replacewithpolyfill() { 'use-strict'; // for safari, and ie > 10 var parent = this.parentnode, i =
arguments.length, currentnode; if (!parent) return; if (!i) // if there are no
arguments parent.removechild(this); while (i--) { // i-- decrements i and returns the value of i before the decrement currentnode =
arguments[i]; if (typeof currentnode !== 'object'){ currentnode = this.ownerdocument.createtextnode(currentnode); } else if (currentnode.parentnode){ currentnode.pa...
...rentnode.removechild(currentnode); } // the value of "i" below is after the decrement if (!i) // if currentnode is the first argument (currentnode ===
arguments[0]) parent.replacechild(currentnode, this); else // if currentnode isn't the first parent.insertbefore(currentnode, this.nextsibling); } } if (!element.prototype.replacewith) element.prototype.replacewith = replacewithpolyfill; if (!characterdata.prototype.replacewith) characterdata.prototype.replacewith = replacewithpolyfill; if (!documenttype.prototype.replacewith) documenttype.prototype.replacewith = replacewithpolyfill; specification specification status comment domthe definition of 'childnode.replacewith()' in that specification.
performance.clearMarks() - Web APIs
if the method is called with no
arguments, all performance entries with an entry type of "mark" will be removed from the performance entry buffer.
... syntax performance.clearmarks(); performance.clearmarks(name);
arguments name optional a domstring representing the name of the timestamp.
performance.clearMeasures() - Web APIs
if the method is called with no
arguments, all performance entries with an entry type of "measure" will be removed from the performance entry buffer.
... syntax performance.clearmeasures(); performance.clearmeasures(name);
arguments name optional a domstring representing the name of the timestamp.
User Timing API - Web APIs
if this method is called with no
arguments, all mark type entries will be removed from the performance timeline.
...if this method is called with no
arguments, all measure type entries will be removed from the performance timeline.
Migrating from webkitAudioContext - Web APIs
// first argument is the audiobuffersourcenode to start, other
arguments are // the argument to the |start()| method of the audiobuffersourcenode.
... function startsource() { var src =
arguments[0]; var startargs = array.prototype.slice.call(
arguments, 1); src.onended = function() { sources.splice(sources.indexof(src), 1); } sources.push(src); src.start.apply(src, startargs); } function activesources() { return sources.length; } var src0 = context.createbuffersource(); var src0 = context.createbuffersource(); // set buffers and other parameters...
Web Authentication API - Web APIs
// sample
arguments for registration var createcredentialdefaultargs = { publickey: { // relying party (a.k.a.
...testation: "direct", timeout: 60000, challenge: new uint8array([ // must be a cryptographically random number sent from a server 0x8c, 0x0a, 0x26, 0xff, 0x22, 0x91, 0xc1, 0xe9, 0xb9, 0x4e, 0x2e, 0x17, 0x1a, 0x98, 0x6a, 0x73, 0x71, 0x9d, 0x43, 0x48, 0xd5, 0xa7, 0x6a, 0x15, 0x7e, 0x38, 0x94, 0x52, 0x77, 0x97, 0x0f, 0xef ]).buffer } }; // sample
arguments for login var getcredentialdefaultargs = { publickey: { timeout: 60000, // allowcredentials: [newcredential] // see below challenge: new uint8array([ // must be a cryptographically random number sent from a server 0x79, 0x50, 0x68, 0x71, 0xda, 0xee, 0xee, 0xb9, 0x94, 0xc3, 0xc2, 0x15, 0x67, 0x65, 0x26, 0x22, 0xe3, 0xf3, 0xab, 0x3b, 0x78, 0x2e, 0...
Using the Web Storage API - Web APIs
this takes two
arguments — the key of the data item to create/modify, and the value to store in it.
... storage.clear() takes no
arguments, and simply empties the entire storage object for that domain.
Basic Shapes - CSS: Cascading Style Sheets
the
arguments which are accepted vary depending on the shape that you are creating.
... circle() the circle() value for shape-outside can accept two possible
arguments.
paint() - CSS: Cascading Style Sheets
parameters optional additional parameters to pass to the paintworklet examples you can pass additional
arguments via the css paint() function.
... in this example, we passed two
arguments: whether the background-image on a group of list items is filled or just has a stroke outline, and the width of that outline: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); li { --boxcolor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 2px); } li...
Using Promises - JavaScript
allback); }, failurecallback); with modern functions, we attach our callbacks to the returned promises instead, forming a promise chain: dosomething() .then(function(result) { return dosomethingelse(result); }) .then(function(newresult) { return dothirdthing(newresult); }) .then(function(finalresult) { console.log('got the final result: ' + finalresult); }) .catch(failurecallback); the
arguments to then are optional, and catch(failurecallback) is short for then(null, failurecallback).
...unctions down to a promise chain equivalent to: promise.resolve().then(func1).then(func2).then(func3); this can be made into a reusable compose function, which is common in functional programming: const applyasync = (acc,val) => acc.then(val); const composeasync = (...funcs) => x => funcs.reduce(applyasync, promise.resolve(x)); the composeasync() function will accept any number of functions as
arguments, and will return a new function that accepts an initial value to be passed through the composition pipeline: const transformdata = composeasync(func1, func2, func3); const result3 = transformdata(data); in ecmascript 2017, sequential composition can be done more simply with async/await: let result; for (const f of [func1, func2, func3]) { result = await f(result); } /* use last result (i.e.
Working with objects - JavaScript
to illustrate how this works, the following function displays the properties of the object when you pass the object and the object's name as
arguments to the function: function showprops(obj, objname) { var result = ``; for (var i in obj) { // obj.hasownproperty() is used to filter out properties from the object's prototype chain if (obj.hasownproperty(i)) { result += `${objname}.${i} = ${obj[i]}\n`; } } return result; } so, the function call showprops(mycar, "mycar") would return the following: mycar.make = ford m...
...ke = make; this.model = model; this.year = year; this.owner = owner; } to instantiate the new objects, you then use the following: var car1 = new car('eagle', 'talon tsi', 1993, rand); var car2 = new car('nissan', '300zx', 1992, ken); notice that instead of passing a literal string or integer value when creating the new objects, the above statements pass the objects rand and ken as the
arguments for the owners.
constructor - JavaScript
syntax constructor([
arguments]) { ...
...if your class is a base class, the default constructor is empty: constructor() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any
arguments that were provided: constructor(...args) { super(...args); } that enables code like this to work: class validationerror extends error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // thi...
Default parameters - JavaScript
me, greeting, message] } greet('david', 'hi') // ["david", "hi", "hi david"] greet('david', 'hi', 'happy birthday!') // ["david", "hi", "happy birthday!"] this functionality can be approximated like this, which demonstrates how many edge cases are handled: function go() { return ':p' } function withdefaults(a, b = 5, c = b, d = go(), e = this, f =
arguments, g = this.value) { return [a, b, c, d, e, f, g] } function withoutdefaults(a, b, c, d, e, f, g) { switch (
arguments.length) { case 0: a; case 1: b = 5; case 2: c = b; case 3: d = go(); case 4: e = this; case 5: f =
arguments; case 6: g = this.value; default: } return [a, b, c, d, e, f, g]; } withdefaults.call({val...
...ue: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="},
arguments, "=^_^="] withoutdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="},
arguments, "=^_^="] scope effects if default parameters are defined for one or more parameter, then a second scope (environment record) is created, specifically for the identifiers within the parameter list.
Array.prototype.filter() - JavaScript
it accepts three
arguments: element the current element being processed in the array.
... callback is invoked with three
arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to filter, it will be used as the callback's this value.
Array.prototype.find() - JavaScript
syntax arr.find(callback(element[, index[, array]])[, thisarg]) parameters callback function to execute on each value in the array, taking 3
arguments: element the current element in the array.
... var thisarg =
arguments[1]; // 5.
Array.prototype.forEach() - JavaScript
it accepts between one and three
arguments: currentvalue the current element being processed in the array.
...(for sparse arrays, see example below.) callback is invoked with three
arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to foreach(), it will be used as callback's this value.
Array.prototype.includes() - JavaScript
the example below illustrates includes() method called on the function's
arguments object.
... (function() { console.log(array.prototype.includes.call(
arguments, 'a')) // true console.log(array.prototype.includes.call(
arguments, 'd')) // false })('a','b','c') please do not add polyfills on reference articles.
Array.prototype.join() - JavaScript
var a = ['wind', 'water', 'fire']; a.join(); // 'wind,water,fire' a.join(', '); // 'wind, water, fire' a.join(' + '); // 'wind + water + fire' a.join(''); // 'windwaterfire' joining an array-like object the following example joins array-like object (
arguments), by calling function.prototype.call on array.prototype.join.
... function f(a, b, c) { var s = array.prototype.join.call(
arguments); console.log(s); // '1,a,true' } f(1, 'a', true); //expected output: "1,a,true" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.join' in that specification.
Array.prototype.some() - JavaScript
syntax arr.some(callback(element[, index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three
arguments: element the current element being processed in the array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the array object being traversed.
BigInt.prototype.toLocaleString() - JavaScript
syntax bigintobj.tolocalestring([locales [, options]]) parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations that ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation-dependent.
Function.length - JavaScript
property attributes of function.length writable no enumerable no configurable yes description length is a property of a function object, and indicates how many
arguments the function expects, i.e.
...by contrast,
arguments.length is local to a function and provides the number of
arguments actually passed to the function.
Intl.DateTimeFormat - JavaScript
var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // tolocalestring without
arguments depends on the implementation, // the default locale, and the default time zone console.log(new intl.datetimeformat().format(date)); // → "12/19/2012" if run with en-us locale (language) and time zone america/los_angeles (utc-0800) using locales this example shows some of the variations in localized date and time formats.
...le, use 'default' console.log(new intl.datetimeformat('default', options).format(date)); // → "12/19/2012, 19:00:00" // sometimes it's helpful to include the period of the day options = {hour: "numeric", dayperiod: "short"}; console.log(new intl.datetimeformat('en-us', options).format(date)); // → 10 at night the used calendar and numbering formats can also be set independently via options
arguments: var options = {calendar: 'chinese', numberingsystem: 'arab'}; var dateformat = new intl.datetimeformat('default', options); var usedoptions = dateformat.resolvedoptions(); console.log(usedoptions.calendar); // → "chinese" console.log(usedoptions.numberingsystem); // → "arab" console.log(usedoptions.timezone); // → "america/new_york" (the users default timezone) specifications ...
Map.prototype.forEach() - JavaScript
it takes the following
arguments: value optional value of each iteration.
... callback is invoked with three
arguments: the entry's value the entry's key the map object being traversed if a thisarg parameter is provided to foreach, it will be passed to callback when invoked, for use as its this value.
Math.atan2() - JavaScript
note that the
arguments to this function pass the y-coordinate first and the x-coordinate second.
... math.atan2() is passed separate x and y
arguments, and math.atan() is passed the ratio of those two
arguments.
Math.min() - JavaScript
if no
arguments are given, the result is infinity.
... if at least one of
arguments cannot be converted to a number, the result is nan.
Math - JavaScript
math.atan2(y, x) returns the arctangent of the quotient of its
arguments.
... math.hypot([x[, y[, …]]]) returns the square root of the sum of squares of its
arguments.
Object.setPrototypeOf() - JavaScript
* **/ object.appendchain = function(ochain, oproto) { if (
arguments.length < 2) { throw new typeerror('object.appendchain - not enough
arguments'); } if (typeof oproto !== 'object' && typeof oproto !== 'string') { throw new typeerror('second argument to object.appendchain must be an object or a string'); } var onewproto = oproto, oreturn = o2nd = olast = ochain instanceof this ?
... ochain : new ochain.constructor(ochain); for (var o1st = this.getprototypeof(o2nd); o1st !== object.prototype && o1st !== function.prototype; o1st = this.getprototypeof(o2nd) ) { o2nd = o1st; } if (oproto.constructor === string) { onewproto = function.prototype; oreturn = function.apply(null, array.prototype.slice.call(
arguments, 1)); this.setprototypeof(oreturn, olast); } this.setprototypeof(o2nd, onewproto); return oreturn; } usage first example: appending a chain to a prototype function mammal() { this.ismammal = 'yes'; } function mammalspecies(smammalspecies) { this.species = smammalspecies; } mammalspecies.prototype = new mammal(); mammalspecies.prototype.constructor = mammalspecies; var ocat = new mammalspecies('felis'); console.log(ocat.i...
Promise.prototype.catch() - JavaScript
demonstration of the internal call: // overriding original promise.prototype.then/catch just to add some logs (function(promise){ var originalthen = promise.prototype.then; var originalcatch = promise.prototype.catch; promise.prototype.then = function(){ console.log('> > > > > > called .then on %o with
arguments: %o', this,
arguments); return originalthen.apply(this,
arguments); }; promise.prototype.catch = function(){ console.error('> > > > > > called .catch on %o with
arguments: %o', this,
arguments); return originalcatch.apply(this,
arguments); }; })(this.promise); // calling catch on an already resolved promise promise.resolve().catch(function xxx(){}); // log...
...s: // > > > > > > called .catch on promise{} with
arguments:
arguments{1} [0: function xxx()] // > > > > > > called .then on promise{} with
arguments:
arguments{2} [0: undefined, 1: function xxx()] description the catch method is used for error handling in promise composition.
Promise.prototype.then() - JavaScript
it takes up to two
arguments: callback functions for the success and failure cases of the promise.
... if one or both
arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any errors.
Proxy() constructor - JavaScript
this constructor takes two mandatory
arguments: target is the object for which you want to create the proxy handler is the object that defines the custom behavior of the proxy.
... const target = { notproxied: "original value", proxied: "original value" }; const handler = { get: function(target, prop, receiver) { if (prop === "proxied") { return "replaced value"; } return reflect.get(...
arguments); } }; const proxy = new proxy(target, handler); console.log(proxy.notproxied); // "original value" console.log(proxy.proxied); // "replaced value" specifications specification ecmascript (ecma-262)the definition of 'proxy constructor' in that specification.
RegExp.prototype[@@replace]() - JavaScript
the
arguments supplied to this function are described in the specifying a function as a parameter section in string.prototype.replace() page.
... examples direct call this method can be used in almost the same way as string.prototype.replace(), except the different this and the different
arguments order.
String.prototype.normalize() - JavaScript
you can use normalize() using the "nfd" or "nfc"
arguments to produce a form of the string that will be the same for all canonically equivalent strings.
... you can use normalize() using the "nfkd" or "nfkc"
arguments to produce a form of the string that will be the same for all compatible strings: let string1 = '\ufb00'; let string2 = '\u0066\u0066'; console.log(string1); // ff console.log(string2); // ff console.log(string1 === string2); // false console.log(string1.length); // 1 console.log(string2.length); // 2 string1 = string1.normalize('nfkd'); string2 = string2.nor...
String.raw() - JavaScript
the first syntax mentioned above is only rarely used, because the javascript engine will call this with proper
arguments for you, (just like with other tag functions).
...// the rest of the
arguments are the substitutions.
TypedArray.prototype.every() - JavaScript
syntax typedarray.every(callback[, thisarg]) parameters callback function to test for each element, taking three
arguments: currentvalue the current element being processed in the typed array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the array object being traversed.
TypedArray.prototype.fill() - JavaScript
the fill method takes up to three
arguments value, start and end.
... the start and end
arguments are optional with default values of 0 and the length of the this object.
TypedArray.prototype.filter() - JavaScript
invoked with
arguments (element, index, typedarray).
... callback is invoked with three
arguments: the value of the element the index of the element the typed array object being traversed if a thisarg parameter is provided to filter, it will be passed to callback when invoked, for use as its this value.
TypedArray.prototype.find() - JavaScript
syntax typedarray.find(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three
arguments: element the current element being processed in the typed array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the typed array object being traversed.
TypedArray.prototype.findIndex() - JavaScript
syntax typedarray.findindex(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three
arguments: element the current element being processed in the typed array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the typed array object being traversed.
TypedArray.prototype.forEach() - JavaScript
syntax typedarray.foreach(callback[, thisarg]) parameters callback function that produces an element of the new typed array, taking three
arguments: currentvalue the current element being processed in the typed array.
... callback is invoked with three
arguments: the element value the element index the typed array being traversed if a thisarg parameter is provided to foreach(), it will be passed to callback when invoked, for use as its this value.
TypedArray.prototype.map() - JavaScript
syntax typedarray.map(mapfn[, thisarg]) parameters mapfn a callback function that produces an element of the new typed array, taking three
arguments: currentvalue the current element being processed in the typed array.
... mapfn is invoked with three
arguments: the value of the element, the index of the element, and the typed array object being traversed.
TypedArray.prototype.reduce() - JavaScript
syntax typedarray.reduce(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four
arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below).
... description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four
arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
TypedArray.prototype.reduceRight() - JavaScript
syntax typedarray.reduceright(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four
arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below).
... description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four
arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
TypedArray.prototype.some() - JavaScript
syntax typedarray.some(callback[, thisarg]) parameters callback function to test for each element, taking three
arguments: currentvalue the current element being processed in the typed array.
... callback is invoked with three
arguments: the value of the element, the index of the element, and the array object being traversed.
TypedArray.prototype.toLocaleString() - JavaScript
syntax typedarray.tolocalestring([locales [, options]]); parameters the locales and options
arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations, which ignore the locales and options
arguments, the locale used and the form of the string returned are entirely implementation dependent.
eval() - JavaScript
with using function() as shown above, you can minify the code string passed to runcodewithdatefunction() far more efficiently because the function
arguments names can be minified too as seen in the minified code below.
..."a.b.c" var result = setdescendantprop(obj, proppath, 1); // obj.a.b.c will now be 1 use functions instead of evaluating snippets of code javascript has first-class functions, which means you can pass functions as
arguments to other apis, store them in variables and objects' properties, and so on.
super - JavaScript
syntax super([
arguments]); // calls the parent constructor.
... super.functiononparent([
arguments]); description when used in a constructor, the super keyword appears alone and must be used before the this keyword is used.
this - JavaScript
set, so it defaults to the global/window object whatsthis.call(obj); // 'custom' as this in the function is set to obj whatsthis.apply(obj); // 'custom' as this in the function is set to obj this and object conversion function add(c, d) { return this.a + this.b + c + d; } var o = {a: 1, b: 3}; // the first parameter is the object to use as // 'this', subsequent parameters are passed as //
arguments in the function call add.call(o, 5, 7); // 16 // the first parameter is the object to use as // 'this', the second is an array whose // members are used as the
arguments in the function call add.apply(o, [10, 20]); // 34 note that in non–strict mode, with call and apply, if the value passed as this is not an object, an attempt will be made to convert it to an object.
...you can still prepend
arguments to the call, but the first argument (thisarg) should be set to null.
yield* - JavaScript
r.next()); // {value: 2, done: false} console.log(iterator.next()); // {value: 3, done: false} console.log(iterator.next()); // {value: 4, done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: undefined, done: true} other iterable objects besides generator objects, yield* can also yield other kinds of iterables (e.g., arrays, strings, or
arguments objects).
... function* g3() { yield* [1, 2]; yield* '34'; yield* array.from(
arguments); } const iterator = g3(5, 6); console.log(iterator.next()); // {value: 1, done: false} console.log(iterator.next()); // {value: 2, done: false} console.log(iterator.next()); // {value: "3", done: false} console.log(iterator.next()); // {value: "4", done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: 6, done: false} console.log(iterator.next()); // {value: undefined, done: true} the value of yield* expression itself yield* is an expression, not a statement—so it evaluates to a value.
for...of - JavaScript
the for...of statement creates a loop iterating over iterable objects, including: built-in string, array, array-like objects (e.g.,
arguments or nodelist), typedarray, map, set, and user-defined iterables.
...a map const iterable = new map([['a', 1], ['b', 2], ['c', 3]]); for (const entry of iterable) { console.log(entry); } // ['a', 1] // ['b', 2] // ['c', 3] for (const [key, value] of iterable) { console.log(value); } // 1 // 2 // 3 iterating over a set const iterable = new set([1, 1, 2, 2, 3, 3]); for (const value of iterable) { console.log(value); } // 1 // 2 // 3 iterating over the
arguments object you can iterate over the
arguments object to examine all of the parameters passed into a javascript function: (function() { for (const argument of
arguments) { console.log(argument); } })(1, 2, 3); // 1 // 2 // 3 iterating over a dom collection iterating over dom collections like nodelist: the following example adds a read class to paragraphs that are direct descendants of an ...
MathML documentation index - MathML
two
arguments are accepted, which leads to the syntax: <mroot> base index </mroot>.
...this element renders as a horizontal row containing its
arguments.
Using custom elements - Web Components
this takes as its
arguments: a domstring representing the name you are giving to the element.
... if you need a constructor and a mandatory super call, remember to pass along optional
arguments and return the result of such a super call operation.
Exported WebAssembly functions - WebAssembly
when you call them, you get some activity in the background to convert the
arguments into types that wasm can work with (for example converting javascript numbers to int32), the
arguments are passed to the function inside your wasm module, the function is invoked, and the result is converted and passed back to javascript.
... some other particulars to be aware of with exported webassembly functions: their length property is the number of declared
arguments in the wasm function signature.
querystring - Archive of obsolete content
parse(querystring, separator, assignment) parse a query string into an object containing name:value pairs: querystring.parse('foo=bar&baz=bla') // => { foo: 'bar', baz: 'bla' } optionally separator and assignment
arguments may be passed to override default '&' and '=' characters: querystring.parse('foo:bar|baz:bla', '|', ':') // => { foo: 'bar', baz: 'bla' } parameters querystring : string the query string.
loader/sandbox - Archive of obsolete content
evaluate code module provides evaluate function that lets you execute code in the given sandbox: evaluate(scope, 'var a = 5;'); evaluate(scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional
arguments that may improve exception reporting: // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line.
util/list - Archive of obsolete content
examples: var { list } = require("sdk/util/list"); var mylist = list.compose({ add: function add(item1, item2, /*item3...*/) { array.slice(
arguments).foreach(this._add.bind(this)); }, remove: function remove(item1, item2, /*item3...*/) { array.slice(
arguments).foreach(this._remove.bind(this)); } }); mylist('foo', 'bar', 'baz').length == 3; // true new mylist('new', 'keyword').length == 2; // true mylist.apply(null, [1, 2, 3]).length == 3; // true let list = mylist(); list.length == 0; ...
util/uuid - Archive of obsolete content
generate uuid to generate a new uuid, call uuid() with no
arguments: let uuid = require('sdk/util/uuid').uuid(); parsing uuid to convert a string representation of a uuid to an nsid, pass the string representation to uuid(): let { uuid } = require('sdk/util/uuid'); let firefoxuuid = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); globals functions uuid(stringid) generate a new uuid, or convert a string representation of a uuid to an nsid.
Alerts and Notifications - Archive of obsolete content
rtsservice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.
arguments = [image, title, msg, false, '']; } using notification box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly).
Miscellaneous - Archive of obsolete content
imilar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.call(
arguments, 1); return fcbundle.formatstringfromname(msg,args,args.length); } else { return fcbundle.getstringfromname(msg); } } /* usage */ alert(getstr("invalid.url", "http://bad/url/", "3")); //for message with parameters alert(getstr("invalid.url")); //for message without parameters getting postdata of a webpage first, you need to get the browser you want, and its historysession.
Preferences - Archive of obsolete content
ref2": // extensions.myextension.pref2 was changed break; } } } myprefobserver.register(); and next, here is a more evolved version of the previous code better fit for code reuse both within a project and across projects (for example, using javascript code modules): /** * @constructor * * @param {string} branch_name * @param {function} callback must have the following
arguments: * branch, pref_leaf_name */ function preflistener(branch_name, callback) { // keeping a reference to the observed preference branch or it will get // garbage collected.
Rosetta - Archive of obsolete content
var ascripts = document.getelementsbytagname("script"), nidx = 0; nidx < ascripts.length; parsescript(ascripts[nidx++]) ); } var odicts = {}, rignoremimes = /^\s*(?:text\/javascript|text\/ecmascript)\s*$/; this.translatescript = parsescript; this.translateall = parsedocument; this.appendcompiler = function (vmimetypes, fcompiler) { if (
arguments.length < 2) { throw new typeerror("rosetta.appendcompiler() \u2013 not enough
arguments"); } if (typeof fcompiler !== "function") { throw new typeerror("rosetta.appendcompiler() \u2013 second argument must be a function"); } if (!array.isarray(vmimetypes)) { odicts[(vmimetypes).tostring()] = fcompiler; return true; } for (var nidx = 0; nidx < vmi...
Sidebar - Archive of obsolete content
for example the code below calls a function defined in the sidebar's context: var sidebarwindow = document.getelementbyid("sidebar").contentwindow; // verify that our sidebar is open at this moment: if (sidebarwindow.location.href == "chrome://yourextension/content/whatever.xul") { // call "yournotificationfunction" in the sidebar's context: sidebarwindow.yournotificationfunction(any
arguments); } testing which sidebar is open the sidebar content may contain different panels (bookmarks, history, webpanel, etc.) and sometimes one wants to only act on the sidebar when it contains a specific panel.
Offering a context menu for form controls - Archive of obsolete content
window.addeventlistener("load", function() { let settargetoriginal = nscontextmenu.prototype.settarget; components.utils.reporterror(settargetoriginal); nscontextmenu.prototype.settarget = function(anode, arangeparent, arangeoffset) { settargetoriginal.apply(this,
arguments); if (this.istargetaformcontrol(anode)) this.shoulddisplay = true; }; }, false); this code, which is run when the window is opened up, works by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a form control.
Adding windows and dialogs - Archive of obsolete content
// if (returnvalue.accepted) { do stuff } the optional parameters are available in the dialog code through the window.
arguments property: let somevalue = window.
arguments[0]; let returnvalue = window.
arguments[1]; // returnvalue.accepted = true; // returnvalue.result = "something"; the parameter named returnvalue is an object that the dialog will modify to reflect what the user did in it.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
red hat 3.4.3-22.fc3) -wall -w -wno-unused -wpointer-arith -wcast-align -wno-long-long -pedantic -pthread -pipe c++ gcc version 3.4.3 20050227 (red hat 3.4.3-22.fc3) -fno-rtti -fno-exceptions -wall -wconversion -wpointer-arith -wcast-align -woverloaded-virtual -wsynth -wno-ctor-dtor-privacy -wno-non-virtual-dtor -wno-long-long -pedantic -fshort-wchar -pthread -pipe -i/usr/x11r6/include configure
arguments --disable-mailnews --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth --enable-crypto --disable-composer --enable-single-profile --disable-profilesharing --with-system-jpeg --with-system-zlib --with-system-png --with-pthreads --disable-tests --disable-jsd --disable-installer '--enable-optimize=-os -g -pipe -m32 -march=i386 ...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
usage insert some html like this into your content: <object classid="clsid:dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2" width="500" height="300"> <param name="type" value="video/quicktime"/> <param name="src" value="http://www.foobar.com/some_movie.mov"/> <!-- custom
arguments --> <param name="loop" value="true"/> </object> the classid attribute tells ie to create an instance of the plug-in hosting control, the width and height specify the dimensions in pixels.
JavaScript crypto - Archive of obsolete content
smflags and cipherflags pkcs11mechanismflags = pkcs11_mech_dsa_flag | pkcs11_mech_skipjack_flag | pkcs11_mech_random_flag; pkcs11cipherflags = 0; return values js_ok_add_module = 3 // successfully added a module js_err_other = -1 // errors other than the following js_err_user_cancel_action = -2 // user aborted an action js_err_incorrect_num_of_
arguments = -3 // calling a method w/ incorrect # of //
arguments js_err_add_module = -5 // error adding a module js_err_bad_module_name = -6 // the module name is invalid js_err_add_module_duplicate = -10 // the module being installed has the // same name as one of the modules that ...
Jetpack Snippets - Archive of obsolete content
)">test</a> <script><![cdata[ //firebug lite bookmarklet code: var firebug=document.createelement('script'); firebug.setattribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'); document.body.appendchild(firebug); (function(){if(window.firebug.version){firebug.init();}else{settimeout(
arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide...
Safely loading URIs - Archive of obsolete content
all three methods take three
arguments: the first argument identifies the source of the uri, the second argument is the uri that one plans to load, and the third argument is a set of flags that can be used to impose additional restrictions on the uris that may be loaded.
Space Manager Detailed Design - Archive of obsolete content
check if the occupied space rect (adjusted) is empty, if so, return an error (note: this could be done earlier, or prevented by the caller) allocate a new bandrect instance with the rect and frame as constructor
arguments, and insert it into the collection via insertbandrect insertbandrect: internal method to insert a band rect into the bandlist in the correct location.
Supporting per-window private browsing - Archive of obsolete content
} } catch(e) { components.utils.reporterror(e); return; } } obtaining an nsiloadcontext for privacy-sensitive apis some apis (such as nsitransferable and nsiwebbrowserpersist) take nsiloadcontext
arguments that are used to determine whether they should be classed as private or not (for example, whether the uri being persisted by saveuri should be added to the permanent download history).
Tamarin Acceptance Test Template - Archive of obsolete content
addtestcase is a function that is defined * in shell.as and takes three
arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * for example, a test might look like this: * * var helloworld = "hello world"; * * addtestcase( * "var helloworld = 'hello world'", // description of the test * "hello world", // expected result * helloworld ); // actual result * */ // a...
Running Tamarin acceptance tests - Archive of obsolete content
can also be using in conjunction with --threads -f --forcerebuild force rebuild all test files -q --quiet : will print a period (.) for each test run regardless of results, then print the test run summary when finished --ascargs= : additional
arguments to pass to asc.jar --vmargs= : additional
arguments to pass to avmshell --random : run tests in random order --timeout : max time for testrun --verify : run a verify pass instead of running abcs --verifyonly : run a -dverifyonly pass: only checks test exitcode (only works with debugger vms) testing the android shell the instructions above apply to running tests on an android device as well, but...
Example Sticky Notes - Archive of obsolete content
unlike virtual property it is called in function context: this.setborder(arg) you also may define any amount of named
arguments using <parameter name="argumentname"/> --> <parameter name="arg"/> <body><![cdata[ this.style.border = arg; ]]></body> </method> </implementation> <handlers> <!-- event handlers.
Return Codes - Archive of obsolete content
no_matching_certificate -206 extracted file was not signed by the certificate used to sign the installation script cant_read_archive -207 xpi package cannot be read invalid_
arguments -208 bad parameters to a function illegal_relative_path -209 illegal relative path user_cancelled -210 user clicked cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 ...
listbox - Archive of obsolete content
selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as
arguments, including the start and end items.
Mozprocess - Archive of obsolete content
basic usage: process = processhandler(['command', '-line', '
arguments'], cwd=none, # working directory for cmd; defaults to none env={}, # environment to use for the process; defaults to os.environ ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profilepath.py processhandler may be subclassed to handle process timeouts (by...
Function.arity - Archive of obsolete content
the arity property used to return the number of
arguments expected by the function, however, it no longer exists and has been replaced by the function.prototype.length property.
New in JavaScript 1.2 - Archive of obsolete content
arguments new properties function.arity new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labe...
New in JavaScript 1.4 - Archive of obsolete content
new features in javascript 1.4 exception handling (throw and try...catch) in operator instanceof operator changed functionality in javascript 1.4 eval() changes (cannot be called indirectly and no longer a method of object)
arguments not a property of functions deprecated function.arity in favor of function.length changes to liveconnect ...
New in JavaScript 1.6 - Archive of obsolete content
array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which
arguments[n] cannot be set if n is greater than the number of formal or actual parameters has been fixed.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
efox 27) use symbol.iterator property (firefox 36) functions rest parameters (firefox 15) default parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27)
arguments[@@iterator] (firefox 46) other features binary and octal numeric literals (firefox 25) template strings (firefox 34) object initializer: shorthand property names (firefox 33) object initializer: computed property names (firefox 34) object initializer: shorthand method names (firefox 34) ...
LiveConnect Overview - Archive of obsolete content
// javascript 1.3 var theclass = java.lang.class.forname("java.lang.string"); var thearray = java.lang.reflect.array.newinstance(theclass, 5); in javascript 1.4 and later, you can pass a javaclass object directly to a method, as shown in the following example: // javascript 1.4 var thearray = java.lang.reflect.array.newinstance(java.lang.string, 5);
arguments of type char in javascript 1.4 and later, you can pass a one-character string to a java method which requires an argument of type char.
forEach - Archive of obsolete content
a much more sane approach would be to count on the implementation to throw errors if wrong
arguments are provided and implement this in fewer lines of code.
Constructor - MDN Web Docs Glossary: Definitions of Web-related terms
syntax // this is a generic default constructor class default function default() { } // this is an overloaded constructor class overloaded // with parameter
arguments function overloaded(arg1, arg2, ...,argn){ } to call the constructor of the class in javascript, use a new operator to assign a new object reference to a variable.
Drawing graphics - Learn web development
to create a camera, add the following lines next: const camera = new three.perspectivecamera(75, window.innerwidth / window.innerheight, 0.1, 1000); camera.position.z = 5; the perspectivecamera() constructor takes four
arguments: the field of view: how wide the area in front of the camera is that should be visible onscreen, in degrees.
Manipulating documents - Learn web development
add the following inside your html <head>: <style> .highlight { color: white; background-color: black; padding: 10px; width: 250px; text-align: center; } </style> now we'll turn to a very useful method for general html manipulation — element.setattribute() — this takes two
arguments, the attribute you want to set on the element, and the value you want to set it to.
Object building practice - Learn web development
the last bit of the initial script looks as follows: function random(min, max) { const num = math.floor(math.random() * (max - min + 1)) + min; return num; } this function takes two numbers as
arguments, and returns a random number in the range between the two.
Deploying our app - Learn web development
this step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to remember the specific build command
arguments for each project.
PBackground
this has lead to a rather awkward pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(
arguments); } else { mipdlprotocol->senddothething(
arguments); } this can get unwieldy very quickly, so a better solution was needed.
Assert.jsm
arguments passed in to this function are: err an error object when the assertion failed or null when it passed message message describing the assertion stack stack trace of the assertion function.
OS.File.Info
object tomsg( in os.file.info value )
arguments returns an object with the same fields as value but that may be serialized and transmitted between threads or processes.
Promise
new promise(executor); parameters executor this function is invoked immediately with the resolving functions as its two
arguments: executor(resolve, reject); the constructor will not return until the executor has completed.
SourceMap.jsm
the
arguments are the same as those to new sourcemapgenerator.
WebRequest.jsm
it takes one mandatory argument and two optional
arguments, as detailed below.
XPCOMUtils.jsm
definelazygetter takes three
arguments: the object to define the property on the name of the property defined the getter function itself, which returns the value and which will be called just once, the first time code tries to access the property.
L10n Checks
you pass both the path to the ini file and the parent directory of the localizations as first
arguments, followed by the locale codes of the locales you want to compare.
gettext
a definition of a string with plurals takes three
arguments: the singular form of the english string, the plural form of the english string, and the number basing on which the function will return the correct (singular or plural) form of the string.
DMD
if you invoke dmd.py without
arguments you will get output appropriate for the mode in which dmd was invoked.
Memory reporting
you could even put the nsmallocsizeoffun in foobarsizes to reduce the number of
arguments.
Profiling with Xperf
to see your xperf version, either run 'xperf' on a command line with no
arguments, or start 'xperfview' and look at help -> about performance analyzer.
Profile Manager
these cause firefox to be launched with various command-line
arguments.
Installing JSHydra
by default, the configure script will obtain a known working copy of spidermonkey; it is possible via the --moz-src and --moz-obj configure
arguments to tell jshydra to use existing copies of the source and build.
L20n Javascript API
ctx.registerlocalenegotiator(function(available, requested, deflocale) { return intl.prioritizelocales(available, requested, deflocale); }); negotiator is a function which takes the following
arguments: available - all locales available to the context instance, requested - locales preferred by the user, deflocale - the default locale to be used as the ultimate fallback, callback - the function to call when the negotiation completes (useful for asynchronous negotiators).
NSPR Poll Method
the
arguments and return value of the poll method are described below.
PLHashComparator
pl_comparevalues compares the values of the
arguments v1 and v2 numerically.
PL_HashTableEnumerateEntries
for each entry, the enumerator function is invoked with the entry, the index (in the sequence of enumeration, starting from 0) of the entry, and arg as
arguments.
PL_NewHashTable
the
arguments keycompare and valuecompare are functions of type plhashcomparator that the hash table library functions use to compare the keys and the values of entries.
PRBool
use pr_false and pr_true for clarity of target type in assignments and actual
arguments.
PRThreadState
threads created with a pr_unjoinable_thread state cannot be used as
arguments to pr_jointhread.
PR_Assert
writes
arguments to the log and terminates execution.
PR_LOG
returns nothing description this macro formats the specified
arguments and writes the output to the log file, if logging is enabled for the specified module and level.
PR_OpenSemaphore
if pr_sem_create is not specified, the third and fourth
arguments are ignored.
Encrypt Decrypt MAC Keys As Session Objects
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(optstate->value); break; case 'd': dbdir = strdup(optstate->value); break; ...
Encrypt and decrypt MAC using token
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(optstate->value); break; case 'd': dbdir = strdup(optstate->value); break; ...
NSS_3.12.1_release_notes.html
ditionally dump socket traffic to stdout bug 430368: vfychain -t option is undocumented bug 430369: vfychain -o succeeds even if -pp is not specified bug 430399: vfychain -pp crashes bug 430405: error log is not produced by cert_pkixverifycert bug 430743: update ssltap to understand the tls session ticket extension bug 430859: pkix: policy mapping fails verification with error invalid
arguments bug 430875: document the policy for the order of cipher suites in ssl_implementedciphers.
NSS_3.12.2_release_notes.html
z.so where available bug 305693: shlibsign generates pqg for every run bug 311483: exposing includecertchain as a parameter to sec_pkcs12addcertandkey bug 390527: get rid of pkixerrormsg variable in pkix_error bug 391560: libpkix does not consistently return pkix_validatenode tree that truly represent failure reasons bug 408260: certutil usage doesn't give enough information about trust
arguments bug 412311: replace pr_interval_no_wait with pr_interval_no_timeout in client initialization calls bug 423839: add multiple pkcs#11 token password command line option to nss tools.
NSS 3.22 release notes
these functions take an explicit mechanism and parameters as
arguments rather than inferring it from the key type using pk11_mapsignkeytype().
NSS Developer Tutorial
variadic macro
arguments are permitted, but their use should be limited to using __va_args__.
Enc Dec MAC Output Public Key as CSR
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a:s:r:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': cmd = option2command(optstate->value); break; case 'd': dbdir = strdup(optstate->value); ...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "gahedsvad:i:o:f:p:z:s:r:n:x:m:t:c:u:e:b:v:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'g': /* generate a csr */ case 'a': /* add cert to database */ case 'h': /* save cert to the hea...
Encrypt Decrypt_MAC_Using Token
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(optstate->value); break; case 'd': dbdir = strdup(optstate->value); break; ...
NSS Sample Code Sample_2_Initialization of NSS
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "d:p:q:f:g:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'd': dbdir = strdup(optstate->value); break; case 'p': plainpass = strdup(optstate->value); break; case 'f': pwfile = strdup(optstate->value); ...
NSS Sample Code Sample_3_Basic Encryption and MACing
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(optstate->value); break; case 'd': dbdir = strdup(optstate->value); break; ...
Initialize NSS database - sample 2
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "d:p:q:f:g:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'd': dbdir = strdup(optstate->value); break; case 'p': plainpass = strdup(optstate->value); break; case 'f': pwfile = strdup(optstate->value); ...
EncDecMAC using token object - sample 3
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(optstate->value); break; case 'd': dbdir = strdup(optstate->value); break; case 'f': pwdata.source = pw_fromfile; pwdata.data = strdup(optstate->value); break; case 'p': pwdata.source = pw...
sample2
progname + 1 : argv[0]; /* parse command line
arguments */ optstate = pl_createoptstate(argc, argv, "gahedsvad:i:o:f:p:z:s:r:n:x:m:t:c:u:e:b:v:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'g': /* generate a csr */ case 'a': /* add cert to database */ case 'h': /* save cert to the header file */ case 'e': /* encrypt with public key from cert in header file */ case 's': ...
nss tech note1
the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeitem(prarenapool *pool, void *dest, const sec_asn1template *t, secitem *item); secstatus sec_quickderdecodeitem(prarenapool* arena, void* dest, const sec_asn1template* templateentry, secitem* src); here is a description of the
arguments : secitem* src† is a structure containing a pointer to the binary data to be decoded, as well as its size.
nss tech note8
for server programs, the function for initializing the server session cache would set these two variables according to two of the
arguments to that function.
Python binding for NSS
debian) now takes optional command line
arguments, -d or --debug will turn on debug options during the build.
Sample manual installation
/usr/include, /usr/lib and /usr/bin for a linux system), you need to edit the corresponding environment variables or compiler/linker
arguments.
FC_Finalize
fc_finalize should check the preserved argument and return ckr_
arguments_bad if preserved is not null.
FC_GetInfo
fc_getinfo should return ckr_
arguments_bad if pinfo is null.
FC_GetTokenInfo
fc_gettokeninfo should return ckr_
arguments_bad if pinfo is null.
NSS functions
updated - function has new
arguments such as new flag or addition to structure.
sslerr.html
sec_error_invalid_args -8187 security library: invalid
arguments.
Necko Architecture
one of the
arguments to the ondataavailable() notification is an nsiinputstream (which can be considered the underlying data).
Rhino Debugger
the debugger is itself a java program which you may run as java org.mozilla.javascript.tools.debugger.main [options] [filename.js] [script-
arguments] where the options are the same as the shell.
Rhino overview
string.prototype.substring for version 1.2 only, the two
arguments are not swapped if the first argument is less than the second one.
Creating JavaScript jstest reftests
reportcompare reportcompare(expected, actual, description) is somewhat like asserteq(actual, expected, description) except that the first two
arguments are swapped, failures are reported via stdout rather than by throwing exceptions, and the matching is fuzzy in an unspecified way.
64-bit Compatibility
builtins and calls when passing
arguments to lirwriter::inscall(), there are four types: argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms.
Bytecodes
the space for a single javascript value is called a "slot", so the categories are: argument slots: holds the actual
arguments passed to the current frame.
Self-hosted builtins in SpiderMonkey
most importantly, it's possible to invoke any function within the scope of any object using the syntax callfunction(fun, receiver, ...args) (or callcontentfunction, see below), which causes fun to be called within the scope of receiver with ...args as its
arguments.
JS::Call
args js::handlevaluearray &
arguments to pass to the function.
JS::Construct
args js::handlevaluearray &
arguments you are passing to the function.
JS::Handle
functions which take gc things or values as
arguments and need to root those
arguments should generally use handles for those
arguments and avoid any explicit rooting.
JSAutoByteString
examples use constructor
arguments { jsstring *str = js::tostring(cx, strval); if (!str) return false; jsautobytestring bytes(cx, str); /* calls js_encodestring internally */ if (!bytes) return false; /* ...do something with bytes...
JSClass.flags
if the global object does not have this flag, then scripts may cause nonstandard behavior by replacing standard constructors or prototypes (such as function.prototype.) objects that can end up with the wrong prototype object, if this flag is not present, include:
arguments objects (ecma 262-3 §10.1.8 specifies "the original object prototype"), function objects (ecma 262-3 §13.2 specifies "the original function prototype"), and objects created by many standard constructors (ecma 262-3 §15.4.2.1 and others).
JSErrorFormatString
argcount uint16_t the number of
arguments to expand in the formatted error message.
JSErrorReport
messageargs const char16_t **
arguments for the error message.
JSExtendedClass.wrappedObject
a wrapper object that wraps an array is considered an array for the purpose of array.prototype.concat and array.concat (which treat array
arguments differently from other
arguments, per ecma 262-3 §15.4.4.4).
JS_ConvertValue
see also mxr id search for js_convertvalue js_convert
arguments js_gettypename js_typeofvalue bug 1125784 ...
JS_DefineFunctions
each array element defines a single function: its name, the native c/c++ implementation, the number of javascript
arguments the function expects, and any property attributes.
JS_DefineObject
use js_constructobject, js_constructobjectwith
arguments, or js_newobject to create a new object without storing it in a property of another object.
JS_DumpNamedRoots
when js_dumpnamedroots calls it, it passes three
arguments: argument type description name const char * the name of the named root.
JS_FS
nargs uint16_t the number of
arguments the function expects.
JS_GET_CLASS
note: in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as
arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*.
JS_GetClass
in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as
arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*.
JS_InitClass
nargs unsigned number of
arguments for the constructor.
JS_IsConstructing
cx and vp must be the
arguments that the engine passed to that jsnative.
JS_New
added in spidermonkey 38 argc unsigned the number of
arguments to pass to the constructor.
JS_NewObjectForConstructor
the standard object creation api, js_newobject, takes explicit
arguments for the class, prototype, and parent of the new object.
JS_ReportError
first it builds an error message from the given sprintf-style format string and any additional
arguments passed after it.
JS_ValueToNumber
see also js_convert
arguments js_convertvalue js_gettypename js_typeofvalue js_valuetoint32 js_valuetoecmaint32 bug 884410 ...
JS_ValueToObject
see also mxr id search for js_valuetoobject js_convert
arguments js_convertvalue js_typeofvalue js_valuetofunction ...
SpiderMonkey 1.8.5
js_clearoperationcallback js_clearregexproots js_decompilescript js_destroyscript js_enterlocalrootscope js_executescriptpart js_forgetlocalroot js_getfunctionname js_getoperationlimit js_getscriptobject js_getstringbytes js_getstringchars js_isassigning js_leavelocalrootscope js_leavelocalrootscopewithresult js_newdouble js_newdoublevalue js_newscriptobject js_newstring js_pop
arguments js_push
arguments js_push
argumentsva js_removeroot js_removerootrt js_sealobject js_setbranchcallback js_setcallreturnvalue2 js_setcheckobjectaccesscallback js_setobjectprincipalsfinder js_setoperationlimit js_setprincipalstranscoder api changes operation callback js_setoperationcallback was introduced in js 1.8.0, replacing the branch callback, in anticipation of the addition of the t...
SpiderMonkey 31
obsolete apis js_convert
arguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by js::toboolean) js_valuetonumber (can be replaced with js::tonumber) js_valuetoint64 (replaced by js::toint64) js_valuetouint64 (replaced by js::touint64) js_valuetoecmauint32 (re...
SpiderMonkey 38
50) jsval_is_void (bug 952650) jsval_to_boolean (bug 952650) jsval_to_double (bug 952650) jsval_to_gcthing (bug 952650) jsval_to_int (bug 952650) jsval_to_object (bug 952650) jsval_to_private (bug 952650) jsval_to_string (bug 952650) js_clearnonglobalobject (bug 1043281) js_clonefunctionobject (bug 1089026) js_compilefunction (bug 1089026) js_compileucfunction (bug 1089026) js_convert
arguments (bug 1125784) js_convert
argumentsva (bug 1125784) js_convertstub (bug 1103152) js_defineownproperty (bug 1017323) js_deletepropertystub (bug 1103152) js_doubletoint32 (bug 1112774) js_doubletouint32 (bug 1112774) js_enumeratestub (bug 1103152) js_evaluatescript (bug 1100579) js_evaluateucscript (bug 1100579) js_executescriptversion (bug 1095660) js_getflatstringchars (bug 1037869) js_...
Setting up CDT to work on SpiderMonkey
the initial build was in clang, so the modified build commands look like this: mkdir _dbg.obj cd _dbg.obj cc='clang -qunused-
arguments -fcolor-diagnostics' cxx='clang++ -qunused-
arguments -fcolor-diagnostics' \ ../configure --enable-debug --disable-optimize --enable-debug-symbols note: if you want to use ccache, you can enable it by adding --with-ccache to the
arguments list.
Web Replay
recording for a lock or atomic can be turned off by specifying recordreplay::behavior::dontpreserve in either the lock's contructor argument or the atomic's template
arguments.
compare-locales
you pass the path to the toml file and the parent dir of the localizations as first
arguments, followed by the locale codes of the locales you want to compare.
Using RAII classes in Mozilla
however, there are some variations for special cases: first, if the constructor (otherwise) takes no
arguments, then you have to use the moz_guard_object_notifier_only_param macro instead.
Redis Tips
commands will only crash if you feed them the wrong
arguments or wrong number of
arguments.
Components.utils.evalInSandbox
components.utils.evalinsandbox("x = y + 2; double(x) + 3", mysandbox); console.log(result); // 17 console.log(mysandbox.x); // 7 operations on objects you insert into this sandbox global scope do not carry privileges into the sandbox: mysandbox.foo = components; // this will give a "permission denied" error components.utils.evalinsandbox("foo.classes", mysandbox); optional
arguments you can optionally specify the js version, filename, and line number of the code being evaluated.
xpcshell
see the xpcshell reference for information on command line
arguments and extension functions.
IAccessibleEditableText
if endoffset is lower than startoffset, the result is the same as a call with the two
arguments exchanged.
IAccessibleText
if endoffset is lower than startoffset, the result is the same as a call with the two
arguments being exchanged.
mozIThirdPartyUtil
(we have already checked that auri is not foreign with respect to the channel uri.) otherwise, return the result of isthirdpartywindow() with
arguments of the channel's bottommost window and the channel uri, respectively.
nsICookieManager
typically, the
arguments to this method will be obtained directly from the desired nsicookie object.
nsIDOMParser
these values are automatically determined as defined below, but if you work with domparser from privileged code, you can override the defaults by providing
arguments to the domparser constructor or calling parser.init().
nsIDialogCreator
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock a
arguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock a
arguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures a
arguments aframeelement optional ...
nsIDragService
if this is supplied, the aimagex and aimagey
arguments specify the offset within the image where the cursor would be positioned.
nsIHttpChannelInternal
the
arguments to nsihttpupgradelistener.ontransportavailable() provide to the new protocol the low level transport streams that are no longer used by http.
nsIHttpServer
(not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (
arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); ...
nsIJetpack
the first argument passed to it is the name of the message, and all
arguments following it are either json-serializable types or handles.
Component; nsIPrefBranch
on preference changes, the following
arguments will be passed to nsiobserver.observe(): asubject - the nsiprefbranch object (this).
nsIPrefBranch2
on preference changes, the following
arguments will be passed to nsiobserver.observe(): asubject - the nsiprefbranch object (this).
nsIPrompt
if you are using this interface, you must remove the nsidomwindow
arguments from those methods.
nsIServiceManager
unlike createinstance, this will always return the same object each time it is called with the same
arguments.
nsITextInputProcessor
how to create keyboardevent instance for nsitextinputprocessor this section describes how to create keyboardevent for
arguments of some methods of nsitextinputprocessor.
nsIWindowMediator
var {cc: classes, ci: interfaces} = components; var windowlistener = { onopenwindow: function (awindow) { // wait for the window to finish loading let domwindow = awindow.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindowinternal || ci.nsidomwindow); domwindow.addeventlistener("load", function () { domwindow.removeeventlistener("load",
arguments.callee, false); //this removes this load function from the window //window has now loaded now do stuff to it //as example this will add a function to listen to tab select and will fire alert in that window if (domwindow.gbrowser && domwindow.gbrowser.tabcontainer) { domwindow.gbrowser.tabcontainer.addeventlistener('tabselect', function () { ...
XPCOM
for more information on the workings of xpcom look elsewhere.how to pass an xpcom object to a new windowif you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the
arguments to the window creation method.interfacing with the xpcom cycle collectorthis is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
XPIDL Syntax
the following is a list of potential features which are parseable but may not result in expected code: struct, union, and enumerated types array declarators (appears to be supported in xpidl_header.c but not xpidl_typelib.c) exception declarations module declarations variable
arguments (that makes the abnf get more wonky) sequence types max-length strings fixed-point numbers "any" and "long double" types.
Mail composition back end
currently, this method does several functions depending on the
arguments passed in, but this could easily lead to confusion.
Library
the syntax for this is seen in firefox codebase here: //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 this shows that we can also supply only two
arguments to the declare function.
Examine, modify, and watch variables - Firefox Developer Tools
examine variables when the code has stopped at a breakpoint, you can examine its state in the variables pane of the debugger: variables are grouped by scope: in function scope you'll see the built-in
arguments and this variables as well as local variables defined by the function like user and greeting.
Debugger.Object - Firefox Developer Tools
apply(this,
arguments) if the referent is callable, call it with the giventhis value and the argument values in
arguments, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invokefunction as a constructor, in which case spidermonkey provides an appropriate this value itself.
arguments must either be an array (in the debugger) of debuggee val...
Debugging Firefox Desktop - Firefox Developer Tools
run the debuggee from the command line, passing it the --start-debugger-server option: /path/to/firefox --start-debugger-server passed with no
arguments, --start-debugger-server makes the debugger server listen on port 6000.
The JavaScript input interpreter - Firefox Developer Tools
e ways to select an iframe using cd(): you can pass the iframe dom element: var frame = document.getelementbyid("frame1"); cd(frame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no
arguments: cd(); for example, suppose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe id="frame1" src="static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta charset="utf-8"> <script> function whoareyou() { return "i'm fram...
AnimationEvent() - Web APIs
syntax animationevent = new animationevent(type, {animationname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname}); parameters the animationevent() constructor also inherits
arguments from event().
BlobEvent.BlobEvent() - Web APIs
syntax blobevent = new blobevent({data: aspecificblob}[, timecode]);
arguments the blobevent() constructor also inherits
arguments from event().
CSSStyleDeclaration.item() - Web APIs
this method doesn't throw exceptions as long as you provide
arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided.
CSSUnparsedValue.forEach() - Web APIs
syntax cssunparsedvalue.foreach(function callback(currentvalue[, index[, array]]) { // your iterator }[, thisarg]); parameters callback the function to execute for each element, taking three
arguments: currentvalue the value of the current element being processed.
CSS Painting API - Web APIs
we create our paintworklet called 'hollowhighlights' using the registerpaint() function: registerpaint('hollowhighlights', class { static get inputproperties() { return ['--boxcolor']; } static get input
arguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thec...
CanvasRenderingContext2D.setTransform() - Web APIs
the canvasrenderingcontext2d.settransform() method of the canvas 2d api resets (overrides) the current transformation to the identity matrix, and then invokes a transformation described by the
arguments of this method.
Channel Messaging API - Web APIs
once created, the two ports of the channel can be accessed through the messagechannel.port1 and messagechannel.port2 properties (which both return messageport objects.) the app that created the channel uses port1, and the app at the other end of the port uses port2 — you send a message to port2, and transfer the port over to the other browsing context using window.postmessage along with two
arguments (the message to send, and the object to transfer ownership of, in this case the port itself.) when these transferable objects are transferred, they are 'neutered' on the previous context — the one they previously belonged to.
ChildNode.before() - Web APIs
// from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argarr = array.prototype.slice.call(
arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
ClipboardEvent() - Web APIs
syntax var clipboardevent = new clipboardevent(type[, options]); parameters the clipboardevent() constructor also inherits
arguments from event().
DOMParser - Web APIs
n; } } catch (ex) {} proto.parsefromstring = function(markup, type) { if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { var doc = document.implementation.createhtmldocument(""); if (markup.tolowercase().indexof('<!doctype') > -1) { doc.documentelement.innerhtml = markup; } else { doc.body.innerhtml = markup; } return doc; } else { return nativeparse.apply(this,
arguments); } }; }(domparser)); specifications specification status comment html living standardthe definition of 'dom parsing' in that specification.
DOMTokenList.forEach() - Web APIs
syntax tokenlist.foreach(callback [, thisarg]); parameters callback function to execute for each element, eventually taking three
arguments: currentvalue the current element being processed in the array.
DataTransfer.mozGetDataAt() - Web APIs
syntax nsivariant datatransfer.mozgetdataat([type], index);
arguments type a string representing the type of the drag data to retrieve from the drag data object.
DataTransfer.mozSetDataAt() - Web APIs
syntax void datatransfer.mozsetdataat([type], data, index);
arguments type a string representing the type of the drag data to add to the drag data object.
DataTransfer.mozTypesAt() - Web APIs
syntax nsivariant datatransfer.moztypesat(index);
arguments index a unsigned long that is the index of the data for which to retrieve the types.
DataTransfer.setData() - Web APIs
syntax void datatransfer.setdata(format, data);
arguments format a domstring representing the type of the drag data to add to the drag object.
DataTransfer.setDragImage() - Web APIs
syntax void datatransfer.setdragimage(img | element, xoffset, yoffset);
arguments img | element an image element element to use for the drag feedback image.
Events and the DOM - Web APIs
eventtarget.addeventlistener // assuming mybutton is a button element mybutton.addeventlistener('click', greet, false) function greet(event){ // print and have a look at the event object // always print
arguments in case of overlooking any other
arguments console.log('greet:',
arguments) alert('hello world') } this is the method you should use in modern web pages.
DragEvent() - Web APIs
syntax event = new dragevent(type, drageventinit);
arguments type is a domstring representing the name of the event (see dragevent event types).
Element.msZoomTo() - Web APIs
syntax element.mszoomto(
arguments); parameters args[in] type: mszoomtooptions contentx[in]: the x-coordinate of the content that is the target of the scroll/zoom.
Using Fetch - Web APIs
really useful in serviceworkers, when you are providing a custom response to a received request using a respondwith() method: const mybody = new blob(); addeventlistener('fetch', function(event) { // serviceworker intercepting a fetch event.respondwith( new response(mybody, { headers: { 'content-type': 'text/plain' } }) ); }); the response() constructor takes two optional
arguments — a body for the response, and an init object (similar to the one that request() accepts.) note: the static method error() simply returns an error response.
FileError - Web APIs
error callbacks are not optional for your sanity although error callbacks are optional, you should include them in the
arguments of the methods for the sake of the sanity of your users.
FileHandle API - Web APIs
var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two
arguments: a name and an optional type.
FocusEvent() - Web APIs
syntax var focusevent = new focusevent(typearg[, focuseventinit]); properties the focusevent() constructor also inherits
arguments from uievent() and from event().
Geolocation API - Web APIs
in both cases, the method call takes up to three
arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data.
HTMLCollection - Web APIs
the htmlcollection interface represents a generic collection (array-like object similar to
arguments) of elements (in document order) and offers methods and properties for selecting from the list.
HTMLKeygenElement - Web APIs
methods name &
arguments return description checkvalidity() boolean always returns true because keygen objects are never candidates for constraint validation.
HTMLTextAreaElement - Web APIs
javascript function insertmetachars(sstarttag, sendtag) { var bdouble =
arguments.length > 1, omsginput = document.myform.mytxtarea, nselstart = omsginput.selectionstart, nselend = omsginput.selectionend, soldtext = omsginput.value; omsginput.value = soldtext.substring(0, nselstart) + (bdouble ?
IDBCursor - Web APIs
idbcursor.continueprimarykey() sets the cursor to the given index key and primary key given as
arguments.
KeyboardEvent.initKeyEvent() - Web APIs
the initkeyevent is the current gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following
arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
KeyboardLayoutMap.forEach() - Web APIs
syntax keyboardlayoutmap.foreach(function callback(currentvalue[, index[, array]]) { //your iterator }[, thisarg]); parameters callback the function to execute for each element, taking three
arguments: currentvalue the value of the current element being processed.
MediaKeyStatusMap.forEach() - Web APIs
syntax mediakeystatusmap.foreach(callback[, thisarg]) parameters callback function to execute for each element, taking three
arguments: currentvalue the current element being processed in the array.
MediaStreamTrackEvent() - Web APIs
syntax var trackevent = new mediastreamtrackevent(type, {track: amediastreamtrack}); parameters the mediastreamtrackevent() constructor also inherits
arguments from event().
MouseEvent.initMouseEvent() - Web APIs
example html <div style="background:red; width:180px; padding:10px;"> <div id="out"></div> <input type="text"> </div> javascript document.body.onclick = function(){ e =
arguments[0]; var dt = e.target,stag = dt.tagname.tolowercase(); document.getelementbyid("out").innerhtml = stag; }; var simulateclick = function(){ var evt = document.createevent("mouseevents"); evt.initmouseevent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); document.body.dispatchevent(evt); } simulateclick(); result specifications specific...
Node.setUserData() - Web APIs
the handler will be passed five
arguments: an operation type integer (e.g., 1 to indicate a clone operation), the user key, the data on the node, the source node (null if being deleted), the destination node (the newly created node or null if none).if no handler is desired, one must specify null.
Notification.icon - Web APIs
examples in our to-do list app (view the app running live), we use the notification() constructor to fire a notification, passing it
arguments to specify the body, icon and title we want.
OfflineAudioContext.OfflineAudioContext() - Web APIs
it is important to note that, whereas you can create a new audiocontext using the new audiocontext() constructor with no
arguments, the offlineaudiocontext() constructor requires three
arguments, since it needs to create an audiobuffer.
ParentNode.append() - Web APIs
/ source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argarr = array.prototype.slice.call(
arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
ParentNode.prepend() - Web APIs
rce: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argarr = array.prototype.slice.call(
arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchild(isnode ?
PerformanceNavigationTiming.toJSON() - Web APIs
syntax json = resourceperfentry.tojson();
arguments none return value json a json object that is the serialization of the performancenavigationtiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes.
PerformanceResourceTiming.toJSON() - Web APIs
syntax json = resourceperfentry.tojson();
arguments none return value json a json object that is the serialization of the performanceresourcetiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes.
PointerEvent.PointerEvent() - Web APIs
syntax event = new pointerevent(type, pointereventinit);
arguments type is a domstring representing the name of the event (see pointerevent event types).
ProgressEvent() - Web APIs
syntax progressevent = new progressevent(type, {lengthcomputable: abooleanvalue, loaded: anumber, total: anumber});
arguments the progressevent() constructor also inherits
arguments from event().
SVGLength - Web APIs
methods name &
arguments return description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object.
SVGLengthList - Web APIs
methods name &
arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGNumberList - Web APIs
methods name &
arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGPointList - Web APIs
methods name &
arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGStringList - Web APIs
methods name &
arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGStylable - Web APIs
methods name &
arguments return description getpresentationattribute(in domstring name) cssvalue returns the base (i.e., static) value of a given presentation attribute as an object of type cssvalue.
SVGTransform - Web APIs
methods name &
arguments return description setmatrix(in svgmatrix matrix) void sets the transform type to svg_transform_matrix, with parameter matrix defining the new transformation.
SVGTransformList - Web APIs
methods name &
arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
StylePropertyMapReadOnly.forEach() - Web APIs
syntax stylepropertymapreadonly.foreach(function callback(currentvalue[, index[, array]]) { //your code }[, thisarg]); parameters callback the function to execute for each element, taking three
arguments: currentvalue the value of the current element being processed.
SubtleCrypto.encrypt() - Web APIs
it takes as its
arguments a key to encrypt with, some algorithm-specific parameters, and the data to encrypt (also known as "plaintext").
SubtleCrypto.verify() - Web APIs
it takes as its
arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data.
Touch() - Web APIs
syntax touch = new touch(touchinit);
arguments touchinit is a touchinit dictionary, having the following fields: "identifier", required, of type long, that is the identification number for the touch point.
TransitionEvent() - Web APIs
syntax transitionevent = new transitionevent(type, {propertyname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname});
arguments the transitionevent() constructor also inherits
arguments from event().
TreeWalker - Web APIs
note: in the context of a treewalker, a node is visible if it exists in the logical view determined by the whattoshow and filter parameter
arguments.
URL.searchParams - Web APIs
the searchparams readonly property of the url interface returns a urlsearchparams object allowing access to the get decoded query
arguments contained in the url.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
let makingoffer = false; pc.onnegotiationneeded = async () => { try { makingoffer = true; await pc.setlocaldescription(); signaler.send({ description: pc.localdescription }); } catch(err) { console.error(err); } finally { makingoffer = false; } }; note that setlocaldescription() without
arguments automatically creates and sets the appropriate description based on the current signalingstate.
window.location - Web APIs
example #6: using bookmarks without changing the hash property: <!doctype html> <html> <head> <meta charset="utf-8"/> <title>mdn example</title> <script> function shownode (onode) { document.documentelement.scrolltop = onode.offsettop; document.documentelement.scrollleft = onode.offsetleft; } function showbookmark (sbookmark, busehash) { if (
arguments.length === 1 || busehash) { location.hash = sbookmark; return; } var obookmark = document.queryselector(sbookmark); if (obookmark) { shownode(obookmark); } } </script> <style> span.intlink { cursor: pointer; color: #0000ff; text-decoration: underline; } </style> </head> <body> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.
window.postMessage() - Web APIs
the
arguments passed to window.postmessage() (i.e., the “message”) are exposed to the receiving window through the event object.
Window - Web APIs
window.dialog
arguments read only gets the
arguments passed to the window (if it's a dialog box) at the time window.showmodaldialog() was called.
WorkerGlobalScope.self - Web APIs
example if you called console.log(self); inside a worker, you will get a worker global scope of the same type as that worker object written to the console — something like the following: dedicatedworkerglobalscope { undefined: undefined, infinity: infinity, math: mathconstructor, nan: nan, intl: object…} infinity: infinity array: function array() { [native code] }
arguments: null caller: null isarray: function isarray() { [native code] } length: 1 name: "array" observe: function observe() { [native code] } prototype: array[0] unobserve: function unobserve() { [native code] } __proto__: function empty() {} <function scope> arraybuffer: function arraybuffer() { [native code] } blob: function blob() { [nativ...
:where() - CSS: Cascading Style Sheets
the difference between :where() and :is() is that :where() always has 0 specificity, whereas :is() takes on the specificity of the most specific selector in its
arguments.
Selector list - CSS: Cascading Style Sheets
a way to remedy this us to use the :is() selector, which simply ignores invalid selectors in its
arguments, but at the cost of all selectors having the same specificity, because of how :is() calculates specificity.
Overview of events and handlers - Developer guides
browsers use as the registration method for the function which will handle those data structures a method called addeventlistener which expects as
arguments a string event type name and the handler function.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
video_160x90_250k.webm \ -f webm_dash_manifest -i video_320x180_500k.webm \ -f webm_dash_manifest -i video_640x360_750k.webm \ -f webm_dash_manifest -i video_1280x720_1500k.webm \ -f webm_dash_manifest -i my_audio.webm \ -c copy \ -map 0 -map 1 -map 2 -map 3 -map 4 \ -f webm_dash_manifest \ -adaptation_sets "id=0,streams=0,1,2,3 id=1,streams=4" \ my_video_manifest.mpd the -map
arguments correspond to the input files in the sequence they are given; you should have one for each file.
Content-Disposition - HTTP
additional parameters are case-insensitive and have
arguments that use quoted-string syntax after the '=' sign.
CSP: base-uri - HTTP
syntax one or more sources can be allowed for the base-uri policy: content-security-policy: base-uri <source>; content-security-policy: base-uri <source> <source>; sources while this directive uses the same
arguments as other csp directives, some of them don’t make sense for `<base>`, such as the keywords 'unsafe-inline' and 'strict-dynamic' <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
CSS Houdini
the worklet also has access to the element's custom properties: they don't need to be passed as function
arguments.
Grammar and types - JavaScript
when you create an array using an array literal, it is initialized with the specified values as its elements, and its length is set to the number of
arguments specified.
Loops and iteration - JavaScript
for...of statement the for...of statement creates a loop iterating over iterable objects (including array, map, set,
arguments object and so on), invoking a custom iteration hook with statements to be executed for the value of each distinct property.
Meta programming - JavaScript
with reflect.has() for example, you get the in operator as a function: reflect.has(object, 'assign') // true a better apply function in es5, you typically use the function.prototype.apply() method to call a function with a given this value and
arguments provided as an array (or an array-like object).
JavaScript Guide - JavaScript
basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures
arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object template literals internationalization regular expressions indexed col...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
ercase', 'normalize', 'tolocaleuppercase', 'localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', 'localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; string[methodname] = function(arg1) { return method.apply(arg1, array.prototype.slice.call(
arguments, 1)); }; }; for (i = 0; i < methodcount; i++) { assignstringgeneric(methods[i]); } }()); ...
SyntaxError: missing formal parameter - JavaScript
ting; }; // syntaxerror: missing formal parameter function log({ obj: "value"}) { console.log(arg) }; // syntaxerror: missing formal parameter you will need to use identifiers in function declarations: function square(number) { return number * number; }; function greet(greeting) { return greeting; }; function log(arg) { console.log(arg) }; you can then call these functions with the
arguments you like: square(2); // 4 greet("howdy"); // "howdy" log({obj: "value"}); // object { obj: "value" } ...
getter - JavaScript
note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one
arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
setter - JavaScript
note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one
arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property.
Array.prototype.flatMap() - JavaScript
syntax var new_array = arr.flatmap(function callback(currentvalue[, index[, array]]) { // return element for new_array }[, thisarg]) parameters callback function that produces an element of the new array, taking three
arguments: currentvalue the current element being processed in the array.
Array.prototype.lastIndexOf() - JavaScript
.4.4.15 // reference: http://es5.github.io/#x15.4.4.15 if (!array.prototype.lastindexof) { array.prototype.lastindexof = function(searchelement /*, fromindex*/) { 'use strict'; if (this === void 0 || this === null) { throw new typeerror(); } var n, k, t = object(this), len = t.length >>> 0; if (len === 0) { return -1; } n = len - 1; if (
arguments.length > 1) { n = number(
arguments[1]); if (n != n) { n = 0; } else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) { n = (n > 0 || -1) * math.floor(math.abs(n)); } } for (k = n >= 0 ?
Array - JavaScript
array.of() creates a new array instance with a variable number of
arguments, regardless of number or type of the
arguments.
AsyncFunction - JavaScript
all
arguments passed to the function are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed.
Date.UTC() - JavaScript
examples using date.utc() the following statement creates a date object with the
arguments treated as utc instead of local: let utcdate = new date(date.utc(2018, 11, 1, 0, 0, 0)); specifications specification ecmascript (ecma-262)the definition of 'date.utc' in that specification.
Error - JavaScript
class customerror extends error { constructor(foo = 'bar', ...params) { // pass remaining
arguments (including vendor specific ones) to parent constructor super(...params) // maintains proper stack trace for where our error was thrown (only available on v8) if (error.capturestacktrace) { error.capturestacktrace(this, customerror) } this.name = 'customerror' // custom debugging information this.foo = foo this.date = new date() } } try { throw new cust...
Function.displayName - JavaScript
somemethod: function() {} }; object.somemethod.displayname = 'somemethod'; console.log(object.somemethod.displayname); // logs "somemethod" try { somemethod } catch(e) { console.log(e); } // referenceerror: somemethod is not defined changing displayname dynamically you can dynamically change the displayname of a function: var object = { // anonymous somemethod: function(value) {
arguments.callee.displayname = 'somemethod (' + value + ')'; } }; console.log(object.somemethod.displayname); // "undefined" object.somemethod('123') console.log(object.somemethod.displayname); // "somemethod (123)" specifications not part of any standard.
GeneratorFunction - JavaScript
all
arguments passed to the function are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed.
Intl.DateTimeFormat() constructor - JavaScript
var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // tolocalestring without
arguments depends on the implementation, // the default locale, and the default time zone console.log(new intl.datetimeformat().format(date)); // → "12/19/2012" if run with en-us locale (language) and time zone america/los_angeles (utc-0800) using timestyle and datestyle let o = new intl.datetimeformat("en" , { timestyle: "short" }); console.log(o.format(date.now())); // "13:31 am" let o = new intl.
Intl - JavaScript
locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all accept locales and options
arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property.
JSON.parse() - JavaScript
then it is called, with the object containing the property being processed as this, and with the property name as a string, and the property value as
arguments.
JSON.stringify() - JavaScript
var a = json.stringify({ foo: "bar", baz: "quux" }) //'{"foo":"bar","baz":"quux"}' var b = json.stringify({ baz: "quux", foo: "bar" }) //'{"baz":"quux","foo":"bar"}' console.log(a !== b) // true // some memoization functions use json.stringify to serialize
arguments, // which may cause a cache miss when encountering the same object like above example of using json.stringify() with localstorage in a case where you want to store an object created by your user and allowing it to be restored even after the browser has been closed, the following example is a model for the applicability of json.stringify(): // creating an example of json var session = { 'scr...
Object.assign() - JavaScript
t be writable: true, enumerable: false, configurable: true object.defineproperty(object, "assign", { value: function assign(target, varargs) { // .length of function is 2 'use strict'; if (target === null || target === undefined) { throw new typeerror('cannot convert undefined or null to object'); } var to = object(target); for (var index = 1; index <
arguments.length; index++) { var nextsource =
arguments[index]; if (nextsource !== null && nextsource !== undefined) { for (var nextkey in nextsource) { // avoid bugs when hasownproperty is shadowed if (object.prototype.hasownproperty.call(nextsource, nextkey)) { to[nextkey] = nextsource[nextkey]; } } } } ...
Object.defineProperty() - JavaScript
when the property is accessed, this function is called without
arguments and with this set to the object through which the property is accessed (this may not be the object on which the property is defined due to inheritance).
Promise - JavaScript
if you are looking to lazily evaluate an expression, consider the arrow function with no
arguments: f = () => expression to create the lazily-evaluated expression, and f() to evaluate.
Proxy - JavaScript
: console.log(proxy2.message1); // world console.log(proxy2.message2); // world with the help of the reflect class we can give some accessors the original behavior and redefine others: const target = { message1: "hello", message2: "everyone" }; const handler3 = { get: function (target, prop, receiver) { if (prop === "message2") { return "world"; } return reflect.get(...
arguments); }, }; const proxy3 = new proxy(target, handler3); console.log(proxy3.message1); // hello console.log(proxy3.message2); // world constructor proxy() creates a new proxy object.
isNaN() - JavaScript
confusing special-case behavior since the very earliest versions of the isnan function specification, its behavior for non-numeric
arguments has been confusing.
parseFloat() - JavaScript
consider number(value) for stricter parsing, which converts to nan for
arguments with invalid characters anywhere.
Standard built-in objects - JavaScript
intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror other
arguments ...
Iteration protocols - JavaScript
whenever an object needs to be iterated (such as at the beginning of a for...of loop), its @@iterator method is called with no
arguments, and the returned iterator is used to obtain the values to be iterated.
Expressions and operators - JavaScript
...obj spread syntax allows an expression to be expanded in places where multiple
arguments (for function calls) or multiple elements (for array literals) are expected.
for await...of - JavaScript
the for await...of statement creates a loop iterating over async iterable objects as well as on sync iterables, including: built-in string, array, array-like objects (e.g.,
arguments or nodelist), typedarray, map, set, and user-defined async/sync iterables.
function* - JavaScript
with yield* function* anothergenerator(i) { yield i + 1; yield i + 2; yield i + 3; } function* generator(i) { yield i; yield* anothergenerator(i); yield i + 10; } var gen = generator(10); console.log(gen.next().value); // 10 console.log(gen.next().value); // 11 console.log(gen.next().value); // 12 console.log(gen.next().value); // 13 console.log(gen.next().value); // 20 passing
arguments into generators function* loggenerator() { console.log(0); console.log(1, yield); console.log(2, yield); console.log(3, yield); } var gen = loggenerator(); // the first call of next executes from the start of the function // until the first yield statement gen.next(); // 0 gen.next('pretzel'); // 1 pretzel gen.next('california'); // 2 california gen.next('mayonnaise'); /...
JavaScript reference - JavaScript
arguments arrow functions default parameters rest parameters additional reference pages lexical grammar data types and data structures strict mode deprecated features ...
<mroot> - MathML
two
arguments are accepted, which leads to the syntax: <mroot> base index </mroot>.
key - XPath
syntax key(keyname ,value )
arguments keyname a string containing the name of the xsl:key element to be used.
lang - XPath
syntax lang(string )
arguments string the language code or localization (language and country) code to be matched.
local-name - XPath
syntax local-name( [node-set] )
arguments node-set (optional) the local name of the first node in this node-set will be returned.
name - XPath
syntax name( [node-set] )
arguments node-set (optional) the qname of the first node in this node-set will be returned.
namespace-uri - XPath
syntax namespace-uri( [node-set] )
arguments node-set (optional) the namespace uri of the first node in this node-set will be returned.
normalize-space - XPath
syntax normalize-space( [string] )
arguments string (optional) the string to be normalized.
not - XPath
syntax not(expression )
arguments expression the expression is evaluated exactly as if it were passed as an argument to the boolean() function.
number - XPath
syntax number( [object] )
arguments object(optional) the object to be converted to a number.
round - XPath
syntax round(decimal )
arguments decimal the decimal number to be rounded.
starts-with - XPath
syntax starts-with(haystack, needle)
arguments haystack the string to look in.
string-length - XPath
syntax string-length( [string] )
arguments string(optional) the string to evaluate.
string - XPath
syntax string( [object] )
arguments object(optional) the object to convert to a string.
substring - XPath
syntax substring(string ,start [,length] )
arguments string the string to evaluate.