Class GLOBALS

Object
   |
   +--GLOBALS

class GLOBALS

 
Method Summary
<static> function add_event_handler(<DOM:element> obj, <String> event, <function> handler)
           Adds an event handler to a DOM node without replacing any existing handlers.
<static> void addTestResult(test, success, index)
           Writes the result of running a test to the DOM.
<static> void alert_on_error(source, msg)
           One possible behavior on error: alert.
<static> void attach_handler(<DOM:element> obj, <function> handler)
           Recursively attaches events to a DOM object.
<static> function bind_lens(<Lens> lens, <String> dom_id, <function> dom_update_callback, <int> polling)
          

Binds a lens to a given id in the document.

<static> Object clone(o, as_array)
           Clones an object or an array (shallowly); anything else is simply returned.
<static> Object createTestInfo(test, count_id, time_id, failures_id, prose)
           Creates the structure for storing test results.
<static> void debugger_on_error(source, msg)
           One possible behavior on error: start a debugger with the debugger keyword.
<static> Object dom_obj(o)
          
<static> DOM:element domify(o)
           Turns an object into a displayable DOM element.
<static> boolean equal(o1, o2)
           Recursively tests equality of objects.
<static> DOM:element get_dom_object(<String> name, <boolean> strict)
           Gets a DOM object in a portable/intelligent way.
<static> boolean has_prop(o, <String> p)
           Determines whether p is a property of o.
<static> void incrementTestCount(countSpan, success)
           Updates a test count.
<static> boolean is_editable(o)
           A predicate for DOM objects which are editable, and which events must be caught for.
<static> boolean is_lens(o)
           Returns true if a given object is a lens.
<static> Object jsify(<DOM:node> e, orig)
           Turns a DOM element into a JavaScript object -- as best it can.
<static> Contract lens_c(<Contract> get_c, <Contract> putback_c)
           A contract for a lens object.
<static> Contract lens_constructor()
           A contract for a Lens-derived lens constructor, that enforces a calling convention, as well as get and putback contracts on the generated lens.
<static> void log_on_error(source, msg)
           One possible behavior on error: log the error to the Firebug console.
<static> Object make_arith_lens(<String> name, <function> op, <function> inv, <function> guard)
           Generates and registers arithmetic lenses.
<static> Object make_dom_node(<String> name, attribs, <Array> children)
           Creates a DOM node.
<static> function make_lens_function(<Lens> lens, <String> name)
           Converts a lens constructor into a lens function.
<static> Object make_tag_lens(<String> name, <String> placement)
          

Makes an LTag-derived lens.

<static> Object merge_objects(<Object> o1, <Object> o2, <function> error)
           Merges two objects.
<static> Object nodify(o, id)
           Turns objects into span elements with ids.
<static> void nonzero_v(v, d)
           The guard used in LTimes and LDivide to prevent v==0 from occuring.
<static> void recordTestTime(test, ms)
           Writes the time taken running a series of tests to the DOM.
<static> void runTests()
           Runs all tests in __tests.
<static> Object scrub(s)
          
<static> void set_error_handler(<function> handler)
           Sets the current error handler.
<static> Object split_object(<Object> o, <function> pred)
           Splits an object in two: one whose properties all match a predicate, and the rest which fail.
<static> void throw_on_error(source, msg)
           One possible behavior on error: throw.
<static> thunk throws_e(<function> f, <function> e_pred)
           Tests that running f throws a value that satisfies e_pred.
<static> Lens unbind_lens(<String> dom_id)
           Unbinds a lens bound to the DOM id dom_id.
<static> void update_lens_prototype(<String> name, <function> fun, <boolean> no_seq)
          

Updates the Lens prototype to have a method with the given name that calls the lens function (see make_lens_function()) fun as the second argument to an LSeq, e.g.


Method Detail

add_event_handler

<static> function add_event_handler(<DOM:element> obj, <String> event, <function> handler)

addTestResult

<static> void addTestResult(test, success, index)

alert_on_error

<static> void alert_on_error(source, msg)

attach_handler

<static> void attach_handler(<DOM:element> obj, <function> handler)

bind_lens

<static> function bind_lens(<Lens> lens, <String> dom_id, <function> dom_update_callback, <int> polling)

clone

<static> Object clone(o, as_array)

createTestInfo

<static> Object createTestInfo(test, count_id, time_id, failures_id, prose)

debugger_on_error

<static> void debugger_on_error(source, msg)

dom_obj

<static> Object dom_obj(o)

domify

<static> DOM:element domify(o)

equal

<static> boolean equal(o1, o2)

get_dom_object

<static> DOM:element get_dom_object(<String> name, <boolean> strict)

has_prop

<static> boolean has_prop(o, <String> p)

incrementTestCount

<static> void incrementTestCount(countSpan, success)

is_editable

<static> boolean is_editable(o)

is_lens

<static> boolean is_lens(o)

jsify

<static> Object jsify(<DOM:node> e, orig)

lens_c

<static> Contract lens_c(<Contract> get_c, <Contract> putback_c)

lens_constructor

<static> Contract lens_constructor()

log_on_error

<static> void log_on_error(source, msg)

make_arith_lens

<static> Object make_arith_lens(<String> name, <function> op, <function> inv, <function> guard)

make_dom_node

<static> Object make_dom_node(<String> name, attribs, <Array> children)

make_lens_function

<static> function make_lens_function(<Lens> lens, <String> name)

make_tag_lens

<static> Object make_tag_lens(<String> name, <String> placement)

merge_objects

<static> Object merge_objects(<Object> o1, <Object> o2, <function> error)

nodify

<static> Object nodify(o, id)

nonzero_v

<static> void nonzero_v(v, d)

recordTestTime

<static> void recordTestTime(test, ms)

runTests

<static> void runTests()

scrub

<static> Object scrub(s)

set_error_handler

<static> void set_error_handler(<function> handler)

split_object

<static> Object split_object(<Object> o, <function> pred)

throw_on_error

<static> void throw_on_error(source, msg)

throws_e

<static> thunk throws_e(<function> f, <function> e_pred)

unbind_lens

<static> Lens unbind_lens(<String> dom_id)

update_lens_prototype

<static> void update_lens_prototype(<String> name, <function> fun, <boolean> no_seq)


Documentation generated by JSDoc on Wed Feb 14 15:36:01 2007