Share via


IVsaEngine.IsCompiled Property

Gets a Boolean value that signifies whether a script engine has successfully compiled the current source state.

public: _property bool get_IsCompiled();
public bool IsCompiled { get; }
Public Property Get IsCompiled() As Boolean

Return Value

Returns true if the current source state of the engine is successfully compiled. Returns false if the script engine does not have a valid compiled state. The default value for this property is false.

Remarks

The script engine may return false even if there is a valid compiled state, but it is out of date; it will do this if the source state has been modified since the last compilation, that is, in cases where the IVsaEngine.IsDirty property is true.

Upon a call to the IVsaEngine.Run method, the engine evaluates the following conditions and proceeds accordingly:

  1. If the most recent call to IVsaEngine.Compile fails, an EngineNotCompiled exception is thrown;

  2. If there is compiled state loaded in the engine, this code is run;

  3. if not, and if there is compiled state in the code cache, this code is run;

  4. if not, and if a callback to IVsaSite.GetCompiledState returns compiled state, this code is run;

  5. if not, the call fails and a GetCompiledStateFailed exception is propagated from step 3.

The following table shows the exceptions that the IsCompiled property can throw.

Exception Type

Condition

EngineClosed

The IVsaEngine.Close method has been called and the engine is closed.

EngineBusy

The engine is currently executing code for another thread.

EngineNotInitialized

The engine has not been initialized.

See Also

Reference

IVsaEngine Interface

IVsaEngine.IsDirty Property

IVsaEngine.Run Method

IVsaSite.GetCompiledState Method