Public Types | Public Member Functions | Public Attributes

jsdIContext Interface Reference

Context object. More...

import "jsdIDebuggerService.idl";

Inheritance diagram for jsdIContext:
Collaboration diagram for jsdIContext:

List of all members.

Public Types

enum  { OPT_STRICT = 1 }
 

OPT_* values must be kept in sync with JSOPTION_* defines in jsapi.h.

More...
enum  { OPT_WERR = 2 }
 

Warnings reported as errors.

More...
enum  { OPT_VAROBJFIX = 4 }
 

Makes eval() use the last object on its 'obj' param's scope chain as the ECMA 'variables object'.

More...
enum  { OPT_ISUPPORTS = 8 }
 

Private data for this object is an nsISupports object.

More...

Public Member Functions

virtual nsresult GetJSContext (JSContext **aJSContext)=0
 Context object.
virtual nsresult GetOptions (PRUint32 *aOptions)=0
 OPT_* values above, OR'd together.
virtual nsresult SetOptions (PRUint32 aOptions)=0
virtual nsresult GetVersion (PRInt32 *aVersion)=0
 Last version set on this context.
virtual nsresult SetVersion (PRInt32 aVersion)=0
virtual nsresult GetTag (PRUint32 *aTag)=0
 Unique tag among all valid jsdIContext objects, useful as a hash key.
virtual nsresult GetPrivateData (nsISupports **aPrivateData)=0
 Private data for this context, if it is an nsISupports, |null| otherwise.
virtual nsresult GetWrappedContext (nsISupports **aWrappedContext)=0
 Retrieve the underlying context wrapped by this jsdIContext.
virtual nsresult GetGlobalObject (jsdIValue **aGlobalObject)=0
 Top of the scope chain for this context.
virtual nsresult GetScriptsEnabled (PRBool *aScriptsEnabled)=0
 |true| if this context should be allowed to run scripts, |false| otherwise.
virtual nsresult SetScriptsEnabled (PRBool aScriptsEnabled)=0

Public Attributes

readonly attribute JSContext JSContext
const long OPT_STRICT = 0x01
 OPT_* values must be kept in sync with JSOPTION_* defines in jsapi.h.
const long OPT_WERR = 0x02
 Warnings reported as errors.
const long OPT_VAROBJFIX = 0x04
 Makes eval() use the last object on its 'obj' param's scope chain as the ECMA 'variables object'.
const long OPT_ISUPPORTS = 0x08
 Private data for this object is an nsISupports object.
attribute unsigned long options
 OPT_* values above, OR'd together.
attribute long version
 Last version set on this context.
readonly attribute unsigned long tag
 Unique tag among all valid jsdIContext objects, useful as a hash key.
readonly attribute nsISupports privateData
 Private data for this context, if it is an nsISupports, |null| otherwise.
readonly attribute nsISupports wrappedContext
 Retrieve the underlying context wrapped by this jsdIContext.
readonly attribute jsdIValue globalObject
 Top of the scope chain for this context.
attribute boolean scriptsEnabled
 |true| if this context should be allowed to run scripts, |false| otherwise.

Detailed Description

Context object.

Only context's which are also nsISupports objects can be reflected by this interface.


Member Enumeration Documentation

anonymous enum

OPT_* values must be kept in sync with JSOPTION_* defines in jsapi.h.

Strict mode is on.

Enumerator:
OPT_STRICT 
anonymous enum

Warnings reported as errors.

Enumerator:
OPT_WERR 
anonymous enum

Makes eval() use the last object on its 'obj' param's scope chain as the ECMA 'variables object'.

Enumerator:
OPT_VAROBJFIX 
anonymous enum

Private data for this object is an nsISupports object.

Attempting to alter this bit will result in an NS_ERROR_ILLEGAL_VALUE.

Enumerator:
OPT_ISUPPORTS 

Member Function Documentation

virtual nsresult jsdIContext::GetGlobalObject ( jsdIValue **  aGlobalObject  )  [pure virtual]

Top of the scope chain for this context.

virtual nsresult jsdIContext::GetJSContext ( JSContext **  aJSContext  )  [pure virtual]

Context object.

Only context's which are also nsISupports objects can be reflected by this interface.

virtual nsresult jsdIContext::GetOptions ( PRUint32 *  aOptions  )  [pure virtual]

OPT_* values above, OR'd together.

virtual nsresult jsdIContext::GetPrivateData ( nsISupports **  aPrivateData  )  [pure virtual]

Private data for this context, if it is an nsISupports, |null| otherwise.

virtual nsresult jsdIContext::GetScriptsEnabled ( PRBool aScriptsEnabled  )  [pure virtual]

|true| if this context should be allowed to run scripts, |false| otherwise.

This attribute is only valid for contexts which implement nsIScriptContext. Setting or getting this attribute on any other context will throw a NS_ERROR_NO_INTERFACE exception.

virtual nsresult jsdIContext::GetTag ( PRUint32 *  aTag  )  [pure virtual]

Unique tag among all valid jsdIContext objects, useful as a hash key.

virtual nsresult jsdIContext::GetVersion ( PRInt32 *  aVersion  )  [pure virtual]

Last version set on this context.

Scripts typically select this with the "language" attribute. See the VERSION_* consts on jsdIDebuggerService.

virtual nsresult jsdIContext::GetWrappedContext ( nsISupports **  aWrappedContext  )  [pure virtual]

Retrieve the underlying context wrapped by this jsdIContext.

virtual nsresult jsdIContext::SetOptions ( PRUint32  aOptions  )  [pure virtual]
virtual nsresult jsdIContext::SetScriptsEnabled ( PRBool  aScriptsEnabled  )  [pure virtual]
virtual nsresult jsdIContext::SetVersion ( PRInt32  aVersion  )  [pure virtual]

Member Data Documentation

Top of the scope chain for this context.

readonly attribute JSContext jsdIContext::JSContext
const long jsdIContext::OPT_ISUPPORTS = 0x08

Private data for this object is an nsISupports object.

Attempting to alter this bit will result in an NS_ERROR_ILLEGAL_VALUE.

const long jsdIContext::OPT_STRICT = 0x01

OPT_* values must be kept in sync with JSOPTION_* defines in jsapi.h.

Strict mode is on.

const long jsdIContext::OPT_VAROBJFIX = 0x04

Makes eval() use the last object on its 'obj' param's scope chain as the ECMA 'variables object'.

const long jsdIContext::OPT_WERR = 0x02

Warnings reported as errors.

attribute unsigned long jsdIContext::options

OPT_* values above, OR'd together.

Private data for this context, if it is an nsISupports, |null| otherwise.

|true| if this context should be allowed to run scripts, |false| otherwise.

This attribute is only valid for contexts which implement nsIScriptContext. Setting or getting this attribute on any other context will throw a NS_ERROR_NO_INTERFACE exception.

readonly attribute unsigned long jsdIContext::tag

Unique tag among all valid jsdIContext objects, useful as a hash key.

attribute long jsdIContext::version

Last version set on this context.

Scripts typically select this with the "language" attribute. See the VERSION_* consts on jsdIDebuggerService.

Retrieve the underlying context wrapped by this jsdIContext.


The documentation for this interface was generated from the following files: