Class Index | File Index

Classes


Class Kernel

Our central 'class' containing a lot of properties and methods we need to build the rest of XPCOMCore on top of.
Defined in: kernel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Kernel(mixinScope)
A pseudo-constructor to make JSDoc happy and actually document things in Kernel.
Field Summary
Field Attributes Field Name and Description
 
$Cc
A shortcut constant to Components.classes.
 
$Ci
A shortcut constant to Components.interfaces.
 
$Cr
A shortcut constant to Components.results.
 
$Cu
A shortcut constant to Components.utils.
 
Returns a reference to an object allowing for get()/set() on environment variables.
 
Taking inspiration from Ruby, this defines the set of paths to check when trying to load a file via either Kernel#load or Kernel#require.
 
Taking inspiration from Ruby, this defines the currently loaded files that have been loaded through Kernel#require.
Method Summary
Method Attributes Method Name and Description
 
Returns the command line arguments this instance of the GRE was started with.
 
$CURRENT_DIRECTORY(stackTraversalDepth)
This method tries to determine the filesystem path to parent directory of the caller code of this method NOTE - see the note on $CURRENT_FILE, as the same applies here.
 
$CURRENT_FILE(stackTraversalDepth)
Taking inspiration from Ruby, this method tries to determine the filesystem path to the caller code of this method.
 
load(featurePath)
Searches Kernel#$LOAD_PATH for files to load into the current global scope.
<inner>  
makeCallingGetter(attr, argsArray)
<inner>  
makeGetter(attr)
 
print(str)
Prints a string to standard out, without a trailing newline.
 
puts(str)
Prints a string to standard out, with a trailing newline.
 
require(featurePath)
Searches Kernel#$LOAD_PATH for features to load into the current global scope.
<inner>  
Class Detail
Kernel(mixinScope)
A pseudo-constructor to make JSDoc happy and actually document things in Kernel. If this method is called with an argument, all properties from Kernel are taken and defined as the return value of getter methods set on the given object.
Parameters:
{Object} mixinScope
Optional argument, any object to mix Kernel's properties into.
Returns:
The prototype object of the Kernel function.
Field Detail
$Cc
A shortcut constant to Components.classes.

$Ci
A shortcut constant to Components.interfaces.

$Cr
A shortcut constant to Components.results.

$Cu
A shortcut constant to Components.utils.

{nsIEnvironment} $ENV
Returns a reference to an object allowing for get()/set() on environment variables.

{Array} $LOAD_PATH
Taking inspiration from Ruby, this defines the set of paths to check when trying to load a file via either Kernel#load or Kernel#require.

{Array} $LOADED_FEATURES
Taking inspiration from Ruby, this defines the currently loaded files that have been loaded through Kernel#require.
Method Detail
{Array} $ARGV()
Returns the command line arguments this instance of the GRE was started with. NOTE: This doesn't play nicely with remoting to existing instances, but for now, we don't really care about that.
Returns:
{Array}

{String} $CURRENT_DIRECTORY(stackTraversalDepth)
This method tries to determine the filesystem path to parent directory of the caller code of this method NOTE - see the note on $CURRENT_FILE, as the same applies here.
Parameters:
{int} stackTraversalDepth
Optional argument, how far to look up the stack to figure out who called us. The default is usually safe.
Throws:
{SelfConceptError}
Thrown when we can't figure out what the filesystem path to the parent directory of the current file is.
Returns:
{String} The path to the current directory

{String} $CURRENT_FILE(stackTraversalDepth)
Taking inspiration from Ruby, this method tries to determine the filesystem path to the caller code of this method. NOTE - when Kernel is mixed into an object, this function gets mixed in via a special case behaviour that makes it a getter that actually calls the function rather than returning the function object itself. This is to facilitate being able to call '$CURRENT_FILE' in your code rather than '$CURRENT_FILE()'. The stackTraversalDepth parameter is there for this reason, since we need to traverse the stack further than normal to find the calling scope than we normally would.
Parameters:
{int} stackTraversalDepth
Optional argument, how far to look up the stack to figure out who called us. The default is usually safe.
Throws:
{SelfConceptError}
Thrown when we can't figure out what the filesystem path to the current file is.
Returns:
{String} The path to the current file

{Boolean} load(featurePath)
Searches Kernel#$LOAD_PATH for files to load into the current global scope. Files loaded via this method will not be added to Kernel#$LOADED_FEATURES and hence can be repeatedly loaded and executed.
Parameters:
{String} featurePath
Full or relative path including file extension to try and load.
Throws:
{LoadError}
Thrown when we can't find the specified file in any directories specified in Kernel#$LOAD_PATH.
Returns:
{Boolean} True if the file was loaded succesfully

<inner> makeCallingGetter(attr, argsArray)
Parameters:
attr
argsArray

<inner> makeGetter(attr)
Parameters:
attr

print(str)
Prints a string to standard out, without a trailing newline.
Parameters:
{String} str
String to print to standard out.

puts(str)
Prints a string to standard out, with a trailing newline.
Parameters:
{String} str
String to print to standard out.

{Boolean} require(featurePath)
Searches Kernel#$LOAD_PATH for features to load into the current global scope. Files loaded via this method will be added to Kernel#$LOADED_FEATURES and hence two consecutive calls to this method will not load and execute the code twice.
Parameters:
{String} featurePath
Full or relative path without the file extension to try and require.
Throws:
{LoadError}
Thrown when we can't find the specified feature in any directories specified in Kernel#$LOAD_PATH.
Returns:
{Boolean} True if successful, false if the specified feature has already been required.

<inner> standardLibraryLoader()

Documentation generated by JsDoc Toolkit 2.3.2 on Wed Oct 21 2009 09:55:02 GMT-0500 (CDT)