SetLanguageVersion() public method

Set the language version.
Set the language version.

Setting the language version will affect functions and scripts compiled subsequently. See the overview documentation for version-specific behavior.

public SetLanguageVersion ( int version ) : void
version int the version as specified by VERSION_1_0, VERSION_1_1, etc.
return void
Ejemplo n.º 1
0
		protected internal override void OnContextCreated(Context cx)
		{
			cx.SetLanguageVersion(languageVersion);
			cx.SetOptimizationLevel(optimizationLevel);
			if (errorReporter != null)
			{
				cx.SetErrorReporter(errorReporter);
			}
			cx.SetGeneratingDebug(generatingDebug);
			base.OnContextCreated(cx);
		}
Ejemplo n.º 2
0
		public virtual void SetUp()
		{
			cx = Context.Enter();
			cx.SetLanguageVersion(Context.VERSION_1_8);
		}
Ejemplo n.º 3
0
		public virtual void SetUp()
		{
			cx = Context.Enter();
			scope = cx.InitStandardObjects();
			cx.SetLanguageVersion(170);
		}
Ejemplo n.º 4
0
		/// <summary>Get and set the language version.</summary>
		/// <remarks>
		/// Get and set the language version.
		/// This method is defined as a JavaScript function.
		/// </remarks>
		public static double Version(Context cx, Scriptable thisObj, object[] args, Function funObj)
		{
			double result = cx.GetLanguageVersion();
			if (args.Length > 0)
			{
				double d = Context.ToNumber(args[0]);
				cx.SetLanguageVersion((int)d);
			}
			return result;
		}