(This differs from fix_ecma.js, which attempts to make builtin objects compliant with the standard.)
Static Public Member Functions | |
String | gensym () |
Generate a unique symbol. | |
Object | cond (Array condarray) |
A Lisp-like cond operator. | |
Array | argumentsToArray (Arguments args) |
Convert an ECMAScript Arguments into a real Array, so join and other Array methods will work. | |
String | argumentsJoin (Arguments args, String sep) |
Convenience which converts Arguments to an Array and calls join, all in one step. | |
Array | keys (Object o) |
return an Array of the keys in the associative array (using "for in") | |
Boolean | isSpecified (Object o) |
true if and only if v is not null and not undefined | |
Boolean | isArray (Object o) |
True if and only if o is an Array. | |
Boolean | isString (Object o) |
True if and only if o is a string primative or a String object. | |
Boolean | isPrimitive (Object o) |
True if and only if o is not an object (such as string or function), or is an object but is a builtin object (such as Array or RegExp). | |
Boolean | isKeyword (String s) |
Whether the string s is an ECMAScript keyword (such as 'else'). | |
Boolean | isReserved (String s) |
Whether the string s is an ECMAScript reserved word (such as 'volatile'). | |
Boolean | isLegalIdentifier (String s) |
Whether the string s is a legal ECMAScript identifier. | |
String | uneval (Object o) |
Produce a string which when eval'd should produce the same object. | |
String | unevalFunctionCall (Function func, Object scopeobj, String symname) |
Produce a String which when eval'd will call the function func with no arguments. | |
String | functionName (Function func) |
Determine a function's name (returning 'anonymous' if none). | |
Array | functionArgumentNames (Function func) |
Return an Array of String declared argument names. | |
String | functionBody (Function func) |
Return the function's body as a String. | |
String | formatStackFrame (Function func) |
Format a single stack frame, as given by a Function object. | |
Function | functionCaller (Function f) |
Return the Function object for the caller of the provided Function object, which must be somewhere in the current stack. | |
Array | getCallers (Number skip, Function op) |
A recursive utility which accumulates the result of calling the function op on each of the stack frames above us, skipping the initial skip frames. | |
Array | getCallerNames (Number skip) |
Utility which calls burst.Lang.getCallers to accumulate just the function names into an Array. | |
String | getCallerName (Number skip) |
Get the function name skip levels up the stack. | |
Array | getCallerArguments (Number skip) |
Utility which calls burst.Lang.getCallers to accumulate the arguments variable at each level. | |
String | getStackTrace (Number skip) |
Return stack trace as a EOL-separated String. | |
Object | callNoStrict (Function func) |
Call the provided function with strict warnings turned off. | |
void | securityEnableRead_moz () |
Enable universal file reading on Mozilla. | |
Object | createActiveXObject (Object progid_obj, String progid_key, String what) |
A utility for creating an ActiveXObject when the correct ProgID for the environment is not known. |
|
Call the provided function with strict warnings turned off. If that isn't possible, just calls the function. Returns the result of the function. |
|
A Lisp-like cond operator. It takes an Array with an even number of elements, which are considered pairs. It returns the first rhs value whose lhs is true. Note that it doesn't invoke or eval anything.
|
|
A utility for creating an ActiveXObject when the correct ProgID for the environment is not known.
if progid_obj[progid_key] is an Array, it iterates through, attempting
|
|
Format a single stack frame, as given by a Function object. The format is: "funcname(argname1: argv1, argname2: argv2)" The greater of actual and declared arguments are given.
This relies on This relies on Function.arguments, which is deprecated. |
|
Return an Array of String declared argument names. This is implemented by parsing the Function.toString() result, which is not standardized in ECMAScript, so this may not work. |
|
Return the function's body as a String. Does not include the surrounding {}. This is implemented by parsing the Function.toString() result, which is not standardized in ECMAScript, so this may not work. Note that this might not match the actual original body. For example, IE seems to add any missing trailing semi-colon. |
|
Return the Function object for the caller of the provided Function object, which must be somewhere in the current stack. Returns null if called at top-level. This will rely either on Function.caller or on Arguments.caller, neither of which is required to exist by standard ECMAScript. If neither is available, it just returns undefined.
|
|
Determine a function's name (returning 'anonymous' if none). This is implemented by parsing the Function.toString() result, which is not standardized in ECMAScript, so this may not work. |
|
Generate a unique symbol. It is globally unique (a single internal counter is used), so it doesn't much matter what object you may attach it to. |
|
Utility which calls burst.Lang.getCallers to accumulate the arguments variable at each level. It converts each arguments to an Array. It therefore returns an Array of Arrays. |
|
A recursive utility which accumulates the result of calling the function op on each of the stack frames above us, skipping the initial skip frames. If op is not specified, it just accumulates the Function objects themselves.
|
|
Return stack trace as a EOL-separated String. Formatting of each line is done by burst.Lang.formatStackFrame. Note that Moz Error objects have a .stack member variable. And JScript dotnet Exception.StackTrace()
|
|
Whether the string s is a legal ECMAScript identifier.
|
|
Enable universal file reading on Mozilla.
Browser SecuritySo far this library has little support related to security APIs. Here is a brief introduction to the builtin security constraints in IE and Mozilla: Mozilla calls their rule the "same origin policy", while Microsoft calls theirs "cross-frame security". On paper, they are the same.
The rule requires the same protocol (http and https differ), the same host (a.foo.com and b.foo.com differ), and the same port (80 and 8000 differ). Two documents can be from different hosts within the same top-level domain if the
Generally, DomDocument and HttpRequest objects are subject to the restrictions as the browser generally. However, versions of both the IE XMLHTTP and the Mozilla XMLHttpRequest objects have been show to be vulnerable to an exploit in which the initial url response is a redirect to a known local file: Script signing is a bit of a morass: Netscape has an API which relies on Java to ask for greater privilege:
|
|
Produce a string which when eval'd should produce the same object. Note that this does not retain any properties associated with a String, Function, or Array (as if they were a normal Object). This has no protectection against self-referential objects, and no support for repeated objects. Note that NS4.6 and above has Object.toSource() which does roughly the same thing, but that is not part of ECMAScript 262-3 |
|
Produce a String which when eval'd will call the function func with no arguments. This is useful for creating strings that may be set in DOM attributes for event handlers, when the circumstances don't allow for a Function value. You can prepend the the result with 'parent.' if for example the expression is to be used in a child popup or frame.
|