diff --git a/Builtins.cs b/Builtins.cs
index 84ef586..c5a98e8 100644
--- a/Builtins.cs
+++ b/Builtins.cs
@@ -11,9 +11,9 @@ public sealed class JSGlobal {
/// Retrieves a name from the global namespace (note that this is the global namespace at the time that the JSIL runtime was loaded).
///
/// The name to retrieve. This may be a literal, or a string-producing expression.
- public dynamic this[string name] {
+ public JsObject this[string name] {
get {
- return null;
+ throw new NotSupportedException("Not available outside JS");
}
}
}
@@ -23,9 +23,9 @@ public sealed class JSLocal {
/// Retrieves a name from the local namespace.
///
/// The name to retrieve. This must be a string literal!
- public dynamic this[string name] {
+ public JsObject this[string name] {
get {
- return null;
+ throw new NotSupportedException("Not available outside JS");
}
}
}
@@ -35,16 +35,16 @@ public static class Builtins {
public static readonly JSLocal Local = new JSLocal();
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, this method call is replaced with an invocation of the builtin javascript eval function.
///
/// The expression to evaluate.
- public static dynamic Eval (string expression) {
- return null;
+ public static JsObject Eval (string expression) {
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, this method call is replaced with an invocation of the builtin JSIL CreateNamedFunction utility.
///
public static T CreateNamedFunction (
@@ -53,7 +53,7 @@ public static T CreateNamedFunction (
string body,
object closure = null
) {
- throw new NotImplementedException("Not available outside JS");
+ throw new NotSupportedException("Not available outside JS");
}
public static bool IsTruthy (dynamic value) {
@@ -67,9 +67,9 @@ public static bool IsFalsy (dynamic value) {
///
/// When running as javascript, this property evaluates to the current scope's this-reference.
///
- public static dynamic This {
+ public static JsObject This {
get {
- return null;
+ throw new NotSupportedException("Not available outside JS");
}
}
@@ -89,7 +89,7 @@ public static class Services {
/// When running as JavaScript this method returns a reference to the named runtime service.
///
/// The name of the runtime service.
- public static dynamic Get (string serviceName, bool throwIfMissing = true) {
+ public static JsObject Get (string serviceName, bool throwIfMissing = true) {
if (throwIfMissing)
throw new NotImplementedException("Services.get is only available at runtime and you passed true for throwIfMissing.");
else
diff --git a/JSObject.cs b/JSObject.cs
new file mode 100644
index 0000000..2e06598
--- /dev/null
+++ b/JSObject.cs
@@ -0,0 +1,247 @@
+#pragma warning disable 1591
+namespace JSIL {
+ using System;
+
+ using JSIL.Meta;
+
+ public class JsObject
+ {
+ private JsObject()
+ {
+ }
+
+ //Should work same as Builtins.Global[key]
+ public static JsObject Global(string key)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ public sealed class JsFunction : JsObject
+ {
+ private JsFunction() : base()
+ {
+ }
+ }
+ }
+
+ public static class JsObjectHelpers
+ {
+ [JSReplacement("$target[$key]")]
+ public static JsObject Get(this JsObject target, string key)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("($target[$key] = $value)")]
+ public static void Set(this JsObject target, string key, TValue value)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("($key in $target)")]
+ public static bool In(this JsObject target, string key)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("(delete $target[$key])")]
+ public static void Delete(this JsObject target, string key)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]()")]
+ public static JsObject Call(this JsObject.JsFunction target, string key)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3, $arg4)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3, $arg4, $arg5)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3, $arg4, $arg5, $arg6)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target[$key]($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8)")]
+ public static JsObject Call(this JsObject.JsFunction target, string key, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null)")]
+ public static JsObject Invoke(this JsObject.JsFunction target)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3, $arg4)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3, $arg4, $arg5)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$target.call(null, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8)")]
+ public static JsObject Invoke(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target()")]
+ public static JsObject New(this JsObject.JsFunction target)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3, $arg4)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3, $arg4, $arg5)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3, $arg4, $arg5, $arg6)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("new $target($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8)")]
+ public static JsObject New(this JsObject.JsFunction target, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+
+ [JSReplacement("$obj")]
+ public static T AssumeType(this JsObject obj)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$T.$$As($obj)")]
+ public static T As(this JsObject obj) where T : class
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$T.$$Cast($obj)")]
+ public static T Cast(this JsObject obj)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ [JSReplacement("$T.$$Is($obj)")]
+ public static bool Is(this JsObject obj)
+ {
+ throw new NotSupportedException("Not available outside JS");
+ }
+
+ // Will wrap JS object in adapter, that implement interface T
+ // If T is not interface, than work same as Cast
+ //public static T Adapt(this JsObject obj)
+ //{
+ // throw new NotSupportedException("Not available outside JS");
+ //}
+ }
+}
diff --git a/Meta.csproj b/Meta.csproj
index f182b8d..23b517b 100644
--- a/Meta.csproj
+++ b/Meta.csproj
@@ -43,6 +43,7 @@
+
diff --git a/Verbatim.cs b/Verbatim.cs
index 2238738..6d50186 100644
--- a/Verbatim.cs
+++ b/Verbatim.cs
@@ -10,196 +10,41 @@
namespace JSIL {
public static class Verbatim {
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
///
/// The script expression.
- public static dynamic Expression (string javascript) {
- return null;
+ public static JsObject Expression (string javascript) {
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into the expression.
- public static dynamic Expression (string javascript, params object[] variables) {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- /// The variables to insert into '$3' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- /// The variables to insert into '$3' placeholder in the expression.
- /// The variables to insert into '$4' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- /// The variables to insert into '$3' placeholder in the expression.
- /// The variables to insert into '$4' placeholder in the expression.
- /// The variables to insert into '$5' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- /// The variables to insert into '$3' placeholder in the expression.
- /// The variables to insert into '$4' placeholder in the expression.
- /// The variables to insert into '$5' placeholder in the expression.
- /// The variables to insert into '$6' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into '$0' placeholder in the expression.
- /// The variables to insert into '$1' placeholder in the expression.
- /// The variables to insert into '$2' placeholder in the expression.
- /// The variables to insert into '$3' placeholder in the expression.
- /// The variables to insert into '$4' placeholder in the expression.
- /// The variables to insert into '$5' placeholder in the expression.
- /// The variables to insert into '$6' placeholder in the expression.
- /// The variables to insert into '$7' placeholder in the expression.
- public static dynamic Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
- {
- return null;
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- ///
- /// The script expression.
- public static T Expression (string javascript) {
- return default(T);
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
- /// When running as JavaScript, the passed-in script code replaces this method call.
- /// Variables can be referenced by index. '$0' is the first variable.
- ///
- /// The script expression.
- /// The variables to insert into the expression.
- public static T Expression (string javascript, params object[] variables) {
- return default(T);
- }
-
- ///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
/// The script expression.
/// The variables to insert into '$0' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0)
+ public static JsObject Expression(string javascript, TArg0 arg0)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
/// The script expression.
/// The variables to insert into '$0' placeholder in the expression.
/// The variables to insert into '$1' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -207,13 +52,13 @@ public static TResult Expression(string javascript, TArg0
/// The variables to insert into '$0' placeholder in the expression.
/// The variables to insert into '$1' placeholder in the expression.
/// The variables to insert into '$2' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -222,13 +67,13 @@ public static TResult Expression(string javascript
/// The variables to insert into '$1' placeholder in the expression.
/// The variables to insert into '$2' placeholder in the expression.
/// The variables to insert into '$3' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method does throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -238,13 +83,13 @@ public static TResult Expression(string jav
/// The variables to insert into '$2' placeholder in the expression.
/// The variables to insert into '$3' placeholder in the expression.
/// The variables to insert into '$4' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method does throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -255,13 +100,13 @@ public static TResult Expression(str
/// The variables to insert into '$3' placeholder in the expression.
/// The variables to insert into '$4' placeholder in the expression.
/// The variables to insert into '$5' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -273,13 +118,13 @@ public static TResult ExpressionThe variables to insert into '$4' placeholder in the expression.
/// The variables to insert into '$5' placeholder in the expression.
/// The variables to insert into '$6' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
///
- /// When running as C#, this method does nothing and returns null.
+ /// When running as C#, this method throws NotSupportedException.
/// When running as JavaScript, the passed-in script code replaces this method call.
/// Variables can be referenced by index. '$0' is the first variable.
///
@@ -292,9 +137,9 @@ public static TResult ExpressionThe variables to insert into '$5' placeholder in the expression.
/// The variables to insert into '$6' placeholder in the expression.
/// The variables to insert into '$7' placeholder in the expression.
- public static TResult Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
+ public static JsObject Expression(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
{
- return default(TResult);
+ throw new NotSupportedException("Not available outside JS");
}
}
}