diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.gitignore b/.gitignore
index 0beca6e..fb36714 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,5 @@ Generator/Generator/Meta/MetadataParserImpl/Metadata__.g
Generator/Generator/Meta/MetadataParserImpl/MetadataLexer.cs
Generator/Generator/Meta/MetadataParserImpl/MetadataParser.cs
Generator/Generator/ParserImpl/WebIDL__.g
+packages/*
+~package/packages.config
diff --git a/Generator/packages-manual/antlr/Antlr3.Runtime.Debug.dll b/Generator/packages-manual/antlr/Antlr3.Runtime.Debug.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Antlr3.Runtime.JavaExtensions.dll b/Generator/packages-manual/antlr/Antlr3.Runtime.JavaExtensions.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Antlr3.Runtime.dll b/Generator/packages-manual/antlr/Antlr3.Runtime.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Antlr3.exe b/Generator/packages-manual/antlr/Antlr3.exe
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Antlr4.StringTemplate.Visualizer.dll b/Generator/packages-manual/antlr/Antlr4.StringTemplate.Visualizer.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Antlr4.StringTemplate.dll b/Generator/packages-manual/antlr/Antlr4.StringTemplate.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/AntlrBuildTask.dll b/Generator/packages-manual/antlr/AntlrBuildTask.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.ActionScript.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.ActionScript.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.C.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.C.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.CSharp2.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.CSharp2.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.CSharp3.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.CSharp3.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Cpp.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Cpp.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Delphi.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Delphi.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Java.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Java.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.JavaScript.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.JavaScript.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.ObjC.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.ObjC.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Perl5.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Perl5.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Python.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Python.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Ruby.dll b/Generator/packages-manual/antlr/Targets/Antlr3.Targets.Ruby.dll
old mode 100644
new mode 100755
diff --git a/Generator/packages/NUnit.2.6.2/lib/nunit.framework.dll b/Generator/packages/NUnit.2.6.2/lib/nunit.framework.dll
old mode 100644
new mode 100755
diff --git a/Web/Web.csproj b/Web/Web.csproj
index 3d89fac..4b95437 100644
--- a/Web/Web.csproj
+++ b/Web/Web.csproj
@@ -114,9 +114,9 @@
- $(SolutionDir)packages\Saltarelle.Runtime.3.0-alpha-0002\tools\Assemblies\mscorlib.dll
+ $(SolutionDir)packages\Saltarelle.Runtime.3.0-alpha\tools\Assemblies\mscorlib.dll
-
-
+
+
\ No newline at end of file
diff --git a/Web/packages.config b/Web/packages.config
index a0d7236..29dec98 100644
--- a/Web/packages.config
+++ b/Web/packages.config
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/build/NuGet.exe b/build/NuGet.exe
old mode 100644
new mode 100755
diff --git a/build/ci.ps1 b/build/ci.ps1
old mode 100644
new mode 100755
diff --git a/build/default.ps1 b/build/default.ps1
old mode 100644
new mode 100755
index 255009a..277245f
--- a/build/default.ps1
+++ b/build/default.ps1
@@ -11,6 +11,7 @@ properties {
}
Function Get-DependencyVersion($RawVersion) {
+ return "3.0-alpha"
If ($RawVersion -Match "-.+$") {
return $RawVersion
}
diff --git a/build/mcpp.exe b/build/mcpp.exe
old mode 100644
new mode 100755
diff --git a/build/psake.ps1 b/build/psake.ps1
old mode 100644
new mode 100755
index 51331d3..7aa5e2a
--- a/build/psake.ps1
+++ b/build/psake.ps1
@@ -20,11 +20,14 @@ param(
[Parameter(Position=6, Mandatory=0)]
[switch]$nologo = $false,
[Parameter(Position=7, Mandatory=0)]
- [switch]$help = $false,
- [Parameter(Position=8, Mandatory=0)]
- [string]$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.path)
+ [switch]$help = $false
)
+# setting $scriptPath here, not as default argument, to support calling as "powershell -File psake.ps1"
+if (!$scriptPath) {
+ $scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.path)
+}
+
$currentThread = [System.Threading.Thread]::CurrentThread
$invariantCulture = [System.Globalization.CultureInfo]::InvariantCulture
$currentThread.CurrentCulture = $invariantCulture
diff --git a/packages/Mono.Options.1.1/Mono.Options.1.1.nupkg b/packages/Mono.Options.1.1/Mono.Options.1.1.nupkg
deleted file mode 100644
index 30ce00b..0000000
Binary files a/packages/Mono.Options.1.1/Mono.Options.1.1.nupkg and /dev/null differ
diff --git a/packages/Mono.Options.1.1/Mono.Options.1.1.nuspec b/packages/Mono.Options.1.1/Mono.Options.1.1.nuspec
deleted file mode 100644
index 47d6f79..0000000
--- a/packages/Mono.Options.1.1/Mono.Options.1.1.nuspec
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- Mono.Options
- 1.1
- Mono.Options
- Jonathan Pryor, Federico Di Gregorio, Rolf Bjarne Kvinge, Mono development team
- Jonathan Pryor, Federico Di Gregorio, Rolf Bjarne Kvinge, Mono development team
- https://github.com/mono/mono/blob/master/mcs/class/Mono.Options/Mono.Options/Options.cs
- false
- A callback-based program option parser for C#. See the documenation at http://docs.go-mono.com/?link=N%3aMono.Options and some examples in the code and under the OptionSet topic at http://docs.go-mono.com/?link=T%3aMono.Options.OptionSet
- A callback-based program option parser for C#.
- v1.1 adds support for hidden options
-
- en-US
- mono commandline parse args arguments options
-
-
-
\ No newline at end of file
diff --git a/packages/Mono.Options.1.1/content/Mono.Options/Options.cs.pp b/packages/Mono.Options.1.1/content/Mono.Options/Options.cs.pp
deleted file mode 100644
index 5af7fe0..0000000
--- a/packages/Mono.Options.1.1/content/Mono.Options/Options.cs.pp
+++ /dev/null
@@ -1,1366 +0,0 @@
-//
-// Options.cs
-//
-// Authors:
-// Jonathan Pryor
-// Federico Di Gregorio
-// Rolf Bjarne Kvinge
-//
-// Copyright (C) 2008 Novell (http://www.novell.com)
-// Copyright (C) 2009 Federico Di Gregorio.
-// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// Compile With:
-// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll
-// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll
-//
-// The LINQ version just changes the implementation of
-// OptionSet.Parse(IEnumerable), and confers no semantic changes.
-
-//
-// A Getopt::Long-inspired option parsing library for C#.
-//
-// NDesk.Options.OptionSet is built upon a key/value table, where the
-// key is a option format string and the value is a delegate that is
-// invoked when the format string is matched.
-//
-// Option format strings:
-// Regex-like BNF Grammar:
-// name: .+
-// type: [=:]
-// sep: ( [^{}]+ | '{' .+ '}' )?
-// aliases: ( name type sep ) ( '|' name type sep )*
-//
-// Each '|'-delimited name is an alias for the associated action. If the
-// format string ends in a '=', it has a required value. If the format
-// string ends in a ':', it has an optional value. If neither '=' or ':'
-// is present, no value is supported. `=' or `:' need only be defined on one
-// alias, but if they are provided on more than one they must be consistent.
-//
-// Each alias portion may also end with a "key/value separator", which is used
-// to split option values if the option accepts > 1 value. If not specified,
-// it defaults to '=' and ':'. If specified, it can be any character except
-// '{' and '}' OR the *string* between '{' and '}'. If no separator should be
-// used (i.e. the separate values should be distinct arguments), then "{}"
-// should be used as the separator.
-//
-// Options are extracted either from the current option by looking for
-// the option name followed by an '=' or ':', or is taken from the
-// following option IFF:
-// - The current option does not contain a '=' or a ':'
-// - The current option requires a value (i.e. not a Option type of ':')
-//
-// The `name' used in the option format string does NOT include any leading
-// option indicator, such as '-', '--', or '/'. All three of these are
-// permitted/required on any named option.
-//
-// Option bundling is permitted so long as:
-// - '-' is used to start the option group
-// - all of the bundled options are a single character
-// - at most one of the bundled options accepts a value, and the value
-// provided starts from the next character to the end of the string.
-//
-// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'
-// as '-Dname=value'.
-//
-// Option processing is disabled by specifying "--". All options after "--"
-// are returned by OptionSet.Parse() unchanged and unprocessed.
-//
-// Unprocessed options are returned from OptionSet.Parse().
-//
-// Examples:
-// int verbose = 0;
-// OptionSet p = new OptionSet ()
-// .Add ("v", v => ++verbose)
-// .Add ("name=|value=", v => Console.WriteLine (v));
-// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"});
-//
-// The above would parse the argument string array, and would invoke the
-// lambda expression three times, setting `verbose' to 3 when complete.
-// It would also print out "A" and "B" to standard output.
-// The returned array would contain the string "extra".
-//
-// C# 3.0 collection initializers are supported and encouraged:
-// var p = new OptionSet () {
-// { "h|?|help", v => ShowHelp () },
-// };
-//
-// System.ComponentModel.TypeConverter is also supported, allowing the use of
-// custom data types in the callback type; TypeConverter.ConvertFromString()
-// is used to convert the value option to an instance of the specified
-// type:
-//
-// var p = new OptionSet () {
-// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) },
-// };
-//
-// Random other tidbits:
-// - Boolean options (those w/o '=' or ':' in the option format string)
-// are explicitly enabled if they are followed with '+', and explicitly
-// disabled if they are followed with '-':
-// string a = null;
-// var p = new OptionSet () {
-// { "a", s => a = s },
-// };
-// p.Parse (new string[]{"-a"}); // sets v != null
-// p.Parse (new string[]{"-a+"}); // sets v != null
-// p.Parse (new string[]{"-a-"}); // sets v == null
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Text;
-using System.Text.RegularExpressions;
-
-#if LINQ
-using System.Linq;
-#endif
-
-#if TEST
-using NDesk.Options;
-#endif
-
-#if NDESK_OPTIONS
-namespace NDesk.Options
-#else
-namespace Mono.Options
-#endif
-{
- static class StringCoda {
-
- public static IEnumerable WrappedLines (string self, params int[] widths)
- {
- IEnumerable w = widths;
- return WrappedLines (self, w);
- }
-
- public static IEnumerable WrappedLines (string self, IEnumerable widths)
- {
- if (widths == null)
- throw new ArgumentNullException ("widths");
- return CreateWrappedLinesIterator (self, widths);
- }
-
- private static IEnumerable CreateWrappedLinesIterator (string self, IEnumerable widths)
- {
- if (string.IsNullOrEmpty (self)) {
- yield return string.Empty;
- yield break;
- }
- using (IEnumerator ewidths = widths.GetEnumerator ()) {
- bool? hw = null;
- int width = GetNextWidth (ewidths, int.MaxValue, ref hw);
- int start = 0, end;
- do {
- end = GetLineEnd (start, width, self);
- char c = self [end-1];
- if (char.IsWhiteSpace (c))
- --end;
- bool needContinuation = end != self.Length && !IsEolChar (c);
- string continuation = "";
- if (needContinuation) {
- --end;
- continuation = "-";
- }
- string line = self.Substring (start, end - start) + continuation;
- yield return line;
- start = end;
- if (char.IsWhiteSpace (c))
- ++start;
- width = GetNextWidth (ewidths, width, ref hw);
- } while (start < self.Length);
- }
- }
-
- private static int GetNextWidth (IEnumerator ewidths, int curWidth, ref bool? eValid)
- {
- if (!eValid.HasValue || (eValid.HasValue && eValid.Value)) {
- curWidth = (eValid = ewidths.MoveNext ()).Value ? ewidths.Current : curWidth;
- // '.' is any character, - is for a continuation
- const string minWidth = ".-";
- if (curWidth < minWidth.Length)
- throw new ArgumentOutOfRangeException ("widths",
- string.Format ("Element must be >= {0}, was {1}.", minWidth.Length, curWidth));
- return curWidth;
- }
- // no more elements, use the last element.
- return curWidth;
- }
-
- private static bool IsEolChar (char c)
- {
- return !char.IsLetterOrDigit (c);
- }
-
- private static int GetLineEnd (int start, int length, string description)
- {
- int end = System.Math.Min (start + length, description.Length);
- int sep = -1;
- for (int i = start; i < end; ++i) {
- if (description [i] == '\n')
- return i+1;
- if (IsEolChar (description [i]))
- sep = i+1;
- }
- if (sep == -1 || end == description.Length)
- return end;
- return sep;
- }
- }
-
- public class OptionValueCollection : IList, IList {
-
- List values = new List ();
- OptionContext c;
-
- internal OptionValueCollection (OptionContext c)
- {
- this.c = c;
- }
-
- #region ICollection
- void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);}
- bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}}
- object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}}
- #endregion
-
- #region ICollection
- public void Add (string item) {values.Add (item);}
- public void Clear () {values.Clear ();}
- public bool Contains (string item) {return values.Contains (item);}
- public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);}
- public bool Remove (string item) {return values.Remove (item);}
- public int Count {get {return values.Count;}}
- public bool IsReadOnly {get {return false;}}
- #endregion
-
- #region IEnumerable
- IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();}
- #endregion
-
- #region IEnumerable
- public IEnumerator GetEnumerator () {return values.GetEnumerator ();}
- #endregion
-
- #region IList
- int IList.Add (object value) {return (values as IList).Add (value);}
- bool IList.Contains (object value) {return (values as IList).Contains (value);}
- int IList.IndexOf (object value) {return (values as IList).IndexOf (value);}
- void IList.Insert (int index, object value) {(values as IList).Insert (index, value);}
- void IList.Remove (object value) {(values as IList).Remove (value);}
- void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);}
- bool IList.IsFixedSize {get {return false;}}
- object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}}
- #endregion
-
- #region IList
- public int IndexOf (string item) {return values.IndexOf (item);}
- public void Insert (int index, string item) {values.Insert (index, item);}
- public void RemoveAt (int index) {values.RemoveAt (index);}
-
- private void AssertValid (int index)
- {
- if (c.Option == null)
- throw new InvalidOperationException ("OptionContext.Option is null.");
- if (index >= c.Option.MaxValueCount)
- throw new ArgumentOutOfRangeException ("index");
- if (c.Option.OptionValueType == OptionValueType.Required &&
- index >= values.Count)
- throw new OptionException (string.Format (
- c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName),
- c.OptionName);
- }
-
- public string this [int index] {
- get {
- AssertValid (index);
- return index >= values.Count ? null : values [index];
- }
- set {
- values [index] = value;
- }
- }
- #endregion
-
- public List ToList ()
- {
- return new List (values);
- }
-
- public string[] ToArray ()
- {
- return values.ToArray ();
- }
-
- public override string ToString ()
- {
- return string.Join (", ", values.ToArray ());
- }
- }
-
- public class OptionContext {
- private Option option;
- private string name;
- private int index;
- private OptionSet set;
- private OptionValueCollection c;
-
- public OptionContext (OptionSet set)
- {
- this.set = set;
- this.c = new OptionValueCollection (this);
- }
-
- public Option Option {
- get {return option;}
- set {option = value;}
- }
-
- public string OptionName {
- get {return name;}
- set {name = value;}
- }
-
- public int OptionIndex {
- get {return index;}
- set {index = value;}
- }
-
- public OptionSet OptionSet {
- get {return set;}
- }
-
- public OptionValueCollection OptionValues {
- get {return c;}
- }
- }
-
- public enum OptionValueType {
- None,
- Optional,
- Required,
- }
-
- public abstract class Option {
- string prototype, description;
- string[] names;
- OptionValueType type;
- int count;
- string[] separators;
- bool hidden;
-
- protected Option (string prototype, string description)
- : this (prototype, description, 1, false)
- {
- }
-
- protected Option (string prototype, string description, int maxValueCount)
- : this (prototype, description, maxValueCount, false)
- {
- }
-
- protected Option (string prototype, string description, int maxValueCount, bool hidden)
- {
- if (prototype == null)
- throw new ArgumentNullException ("prototype");
- if (prototype.Length == 0)
- throw new ArgumentException ("Cannot be the empty string.", "prototype");
- if (maxValueCount < 0)
- throw new ArgumentOutOfRangeException ("maxValueCount");
-
- this.prototype = prototype;
- this.description = description;
- this.count = maxValueCount;
- this.names = (this is OptionSet.Category)
- // append GetHashCode() so that "duplicate" categories have distinct
- // names, e.g. adding multiple "" categories should be valid.
- ? new[]{prototype + this.GetHashCode ()}
- : prototype.Split ('|');
-
- if (this is OptionSet.Category)
- return;
-
- this.type = ParsePrototype ();
- this.hidden = hidden;
-
- if (this.count == 0 && type != OptionValueType.None)
- throw new ArgumentException (
- "Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
- "OptionValueType.Optional.",
- "maxValueCount");
- if (this.type == OptionValueType.None && maxValueCount > 1)
- throw new ArgumentException (
- string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount),
- "maxValueCount");
- if (Array.IndexOf (names, "<>") >= 0 &&
- ((names.Length == 1 && this.type != OptionValueType.None) ||
- (names.Length > 1 && this.MaxValueCount > 1)))
- throw new ArgumentException (
- "The default option handler '<>' cannot require values.",
- "prototype");
- }
-
- public string Prototype {get {return prototype;}}
- public string Description {get {return description;}}
- public OptionValueType OptionValueType {get {return type;}}
- public int MaxValueCount {get {return count;}}
- public bool Hidden {get {return hidden;}}
-
- public string[] GetNames ()
- {
- return (string[]) names.Clone ();
- }
-
- public string[] GetValueSeparators ()
- {
- if (separators == null)
- return new string [0];
- return (string[]) separators.Clone ();
- }
-
- protected static T Parse (string value, OptionContext c)
- {
- Type tt = typeof (T);
- bool nullable = tt.IsValueType && tt.IsGenericType &&
- !tt.IsGenericTypeDefinition &&
- tt.GetGenericTypeDefinition () == typeof (Nullable<>);
- Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T);
- TypeConverter conv = TypeDescriptor.GetConverter (targetType);
- T t = default (T);
- try {
- if (value != null)
- t = (T) conv.ConvertFromString (value);
- }
- catch (Exception e) {
- throw new OptionException (
- string.Format (
- c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."),
- value, targetType.Name, c.OptionName),
- c.OptionName, e);
- }
- return t;
- }
-
- internal string[] Names {get {return names;}}
- internal string[] ValueSeparators {get {return separators;}}
-
- static readonly char[] NameTerminator = new char[]{'=', ':'};
-
- private OptionValueType ParsePrototype ()
- {
- char type = '\0';
- List seps = new List ();
- for (int i = 0; i < names.Length; ++i) {
- string name = names [i];
- if (name.Length == 0)
- throw new ArgumentException ("Empty option names are not supported.", "prototype");
-
- int end = name.IndexOfAny (NameTerminator);
- if (end == -1)
- continue;
- names [i] = name.Substring (0, end);
- if (type == '\0' || type == name [end])
- type = name [end];
- else
- throw new ArgumentException (
- string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]),
- "prototype");
- AddSeparators (name, end, seps);
- }
-
- if (type == '\0')
- return OptionValueType.None;
-
- if (count <= 1 && seps.Count != 0)
- throw new ArgumentException (
- string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count),
- "prototype");
- if (count > 1) {
- if (seps.Count == 0)
- this.separators = new string[]{":", "="};
- else if (seps.Count == 1 && seps [0].Length == 0)
- this.separators = null;
- else
- this.separators = seps.ToArray ();
- }
-
- return type == '=' ? OptionValueType.Required : OptionValueType.Optional;
- }
-
- private static void AddSeparators (string name, int end, ICollection seps)
- {
- int start = -1;
- for (int i = end+1; i < name.Length; ++i) {
- switch (name [i]) {
- case '{':
- if (start != -1)
- throw new ArgumentException (
- string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
- "prototype");
- start = i+1;
- break;
- case '}':
- if (start == -1)
- throw new ArgumentException (
- string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
- "prototype");
- seps.Add (name.Substring (start, i-start));
- start = -1;
- break;
- default:
- if (start == -1)
- seps.Add (name [i].ToString ());
- break;
- }
- }
- if (start != -1)
- throw new ArgumentException (
- string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
- "prototype");
- }
-
- public void Invoke (OptionContext c)
- {
- OnParseComplete (c);
- c.OptionName = null;
- c.Option = null;
- c.OptionValues.Clear ();
- }
-
- protected abstract void OnParseComplete (OptionContext c);
-
- public override string ToString ()
- {
- return Prototype;
- }
- }
-
- public abstract class ArgumentSource {
-
- protected ArgumentSource ()
- {
- }
-
- public abstract string[] GetNames ();
- public abstract string Description { get; }
- public abstract bool GetArguments (string value, out IEnumerable replacement);
-
- public static IEnumerable GetArgumentsFromFile (string file)
- {
- return GetArguments (File.OpenText (file), true);
- }
-
- public static IEnumerable GetArguments (TextReader reader)
- {
- return GetArguments (reader, false);
- }
-
- // Cribbed from mcs/driver.cs:LoadArgs(string)
- static IEnumerable GetArguments (TextReader reader, bool close)
- {
- try {
- StringBuilder arg = new StringBuilder ();
-
- string line;
- while ((line = reader.ReadLine ()) != null) {
- int t = line.Length;
-
- for (int i = 0; i < t; i++) {
- char c = line [i];
-
- if (c == '"' || c == '\'') {
- char end = c;
-
- for (i++; i < t; i++){
- c = line [i];
-
- if (c == end)
- break;
- arg.Append (c);
- }
- } else if (c == ' ') {
- if (arg.Length > 0) {
- yield return arg.ToString ();
- arg.Length = 0;
- }
- } else
- arg.Append (c);
- }
- if (arg.Length > 0) {
- yield return arg.ToString ();
- arg.Length = 0;
- }
- }
- }
- finally {
- if (close)
- reader.Close ();
- }
- }
- }
-
- public class ResponseFileSource : ArgumentSource {
-
- public override string[] GetNames ()
- {
- return new string[]{"@file"};
- }
-
- public override string Description {
- get {return "Read response file for more options.";}
- }
-
- public override bool GetArguments (string value, out IEnumerable replacement)
- {
- if (string.IsNullOrEmpty (value) || !value.StartsWith ("@")) {
- replacement = null;
- return false;
- }
- replacement = ArgumentSource.GetArgumentsFromFile (value.Substring (1));
- return true;
- }
- }
-
- [Serializable]
- public class OptionException : Exception {
- private string option;
-
- public OptionException ()
- {
- }
-
- public OptionException (string message, string optionName)
- : base (message)
- {
- this.option = optionName;
- }
-
- public OptionException (string message, string optionName, Exception innerException)
- : base (message, innerException)
- {
- this.option = optionName;
- }
-
- protected OptionException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- this.option = info.GetString ("OptionName");
- }
-
- public string OptionName {
- get {return this.option;}
- }
-
- [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("OptionName", option);
- }
- }
-
- public delegate void OptionAction (TKey key, TValue value);
-
- public class OptionSet : KeyedCollection
- {
- public OptionSet ()
- : this (delegate (string f) {return f;})
- {
- }
-
- public OptionSet (Converter localizer)
- {
- this.localizer = localizer;
- this.roSources = new ReadOnlyCollection(sources);
- }
-
- Converter localizer;
-
- public Converter MessageLocalizer {
- get {return localizer;}
- }
-
- List sources = new List ();
- ReadOnlyCollection roSources;
-
- public ReadOnlyCollection ArgumentSources {
- get {return roSources;}
- }
-
-
- protected override string GetKeyForItem (Option item)
- {
- if (item == null)
- throw new ArgumentNullException ("option");
- if (item.Names != null && item.Names.Length > 0)
- return item.Names [0];
- // This should never happen, as it's invalid for Option to be
- // constructed w/o any names.
- throw new InvalidOperationException ("Option has no names!");
- }
-
- [Obsolete ("Use KeyedCollection.this[string]")]
- protected Option GetOptionForName (string option)
- {
- if (option == null)
- throw new ArgumentNullException ("option");
- try {
- return base [option];
- }
- catch (KeyNotFoundException) {
- return null;
- }
- }
-
- protected override void InsertItem (int index, Option item)
- {
- base.InsertItem (index, item);
- AddImpl (item);
- }
-
- protected override void RemoveItem (int index)
- {
- Option p = Items [index];
- base.RemoveItem (index);
- // KeyedCollection.RemoveItem() handles the 0th item
- for (int i = 1; i < p.Names.Length; ++i) {
- Dictionary.Remove (p.Names [i]);
- }
- }
-
- protected override void SetItem (int index, Option item)
- {
- base.SetItem (index, item);
- AddImpl (item);
- }
-
- private void AddImpl (Option option)
- {
- if (option == null)
- throw new ArgumentNullException ("option");
- List added = new List (option.Names.Length);
- try {
- // KeyedCollection.InsertItem/SetItem handle the 0th name.
- for (int i = 1; i < option.Names.Length; ++i) {
- Dictionary.Add (option.Names [i], option);
- added.Add (option.Names [i]);
- }
- }
- catch (Exception) {
- foreach (string name in added)
- Dictionary.Remove (name);
- throw;
- }
- }
-
- public OptionSet Add (string header)
- {
- if (header == null)
- throw new ArgumentNullException ("header");
- Add (new Category (header));
- return this;
- }
-
- internal sealed class Category : Option {
-
- // Prototype starts with '=' because this is an invalid prototype
- // (see Option.ParsePrototype(), and thus it'll prevent Category
- // instances from being accidentally used as normal options.
- public Category (string description)
- : base ("=:Category:= " + description, description)
- {
- }
-
- protected override void OnParseComplete (OptionContext c)
- {
- throw new NotSupportedException ("Category.OnParseComplete should not be invoked.");
- }
- }
-
-
- public new OptionSet Add (Option option)
- {
- base.Add (option);
- return this;
- }
-
- sealed class ActionOption : Option {
- Action action;
-
- public ActionOption (string prototype, string description, int count, Action action)
- : this (prototype, description, count, action, false)
- {
- }
-
- public ActionOption (string prototype, string description, int count, Action action, bool hidden)
- : base (prototype, description, count, hidden)
- {
- if (action == null)
- throw new ArgumentNullException ("action");
- this.action = action;
- }
-
- protected override void OnParseComplete (OptionContext c)
- {
- action (c.OptionValues);
- }
- }
-
- public OptionSet Add (string prototype, Action action)
- {
- return Add (prototype, null, action);
- }
-
- public OptionSet Add (string prototype, string description, Action action)
- {
- return Add (prototype, description, action, false);
- }
-
- public OptionSet Add (string prototype, string description, Action action, bool hidden)
- {
- if (action == null)
- throw new ArgumentNullException ("action");
- Option p = new ActionOption (prototype, description, 1,
- delegate (OptionValueCollection v) { action (v [0]); }, hidden);
- base.Add (p);
- return this;
- }
-
- public OptionSet Add (string prototype, OptionAction action)
- {
- return Add (prototype, null, action);
- }
-
- public OptionSet Add (string prototype, string description, OptionAction action)
- {
- return Add (prototype, description, action, false);
- }
-
- public OptionSet Add (string prototype, string description, OptionAction action, bool hidden) {
- if (action == null)
- throw new ArgumentNullException ("action");
- Option p = new ActionOption (prototype, description, 2,
- delegate (OptionValueCollection v) {action (v [0], v [1]);}, hidden);
- base.Add (p);
- return this;
- }
-
- sealed class ActionOption : Option {
- Action action;
-
- public ActionOption (string prototype, string description, Action action)
- : base (prototype, description, 1)
- {
- if (action == null)
- throw new ArgumentNullException ("action");
- this.action = action;
- }
-
- protected override void OnParseComplete (OptionContext c)
- {
- action (Parse (c.OptionValues [0], c));
- }
- }
-
- sealed class ActionOption : Option {
- OptionAction action;
-
- public ActionOption (string prototype, string description, OptionAction action)
- : base (prototype, description, 2)
- {
- if (action == null)
- throw new ArgumentNullException ("action");
- this.action = action;
- }
-
- protected override void OnParseComplete (OptionContext c)
- {
- action (
- Parse (c.OptionValues [0], c),
- Parse (c.OptionValues [1], c));
- }
- }
-
- public OptionSet Add (string prototype, Action action)
- {
- return Add (prototype, null, action);
- }
-
- public OptionSet Add (string prototype, string description, Action action)
- {
- return Add (new ActionOption (prototype, description, action));
- }
-
- public OptionSet Add (string prototype, OptionAction action)
- {
- return Add (prototype, null, action);
- }
-
- public OptionSet Add (string prototype, string description, OptionAction action)
- {
- return Add (new ActionOption (prototype, description, action));
- }
-
- public OptionSet Add (ArgumentSource source)
- {
- if (source == null)
- throw new ArgumentNullException ("source");
- sources.Add (source);
- return this;
- }
-
- protected virtual OptionContext CreateOptionContext ()
- {
- return new OptionContext (this);
- }
-
- public List Parse (IEnumerable arguments)
- {
- if (arguments == null)
- throw new ArgumentNullException ("arguments");
- OptionContext c = CreateOptionContext ();
- c.OptionIndex = -1;
- bool process = true;
- List unprocessed = new List ();
- Option def = Contains ("<>") ? this ["<>"] : null;
- ArgumentEnumerator ae = new ArgumentEnumerator (arguments);
- foreach (string argument in ae) {
- ++c.OptionIndex;
- if (argument == "--") {
- process = false;
- continue;
- }
- if (!process) {
- Unprocessed (unprocessed, def, c, argument);
- continue;
- }
- if (AddSource (ae, argument))
- continue;
- if (!Parse (argument, c))
- Unprocessed (unprocessed, def, c, argument);
- }
- if (c.Option != null)
- c.Option.Invoke (c);
- return unprocessed;
- }
-
- class ArgumentEnumerator : IEnumerable {
- List> sources = new List> ();
-
- public ArgumentEnumerator (IEnumerable arguments)
- {
- sources.Add (arguments.GetEnumerator ());
- }
-
- public void Add (IEnumerable arguments)
- {
- sources.Add (arguments.GetEnumerator ());
- }
-
- public IEnumerator GetEnumerator ()
- {
- do {
- IEnumerator c = sources [sources.Count-1];
- if (c.MoveNext ())
- yield return c.Current;
- else {
- c.Dispose ();
- sources.RemoveAt (sources.Count-1);
- }
- } while (sources.Count > 0);
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
- }
-
- bool AddSource (ArgumentEnumerator ae, string argument)
- {
- foreach (ArgumentSource source in sources) {
- IEnumerable replacement;
- if (!source.GetArguments (argument, out replacement))
- continue;
- ae.Add (replacement);
- return true;
- }
- return false;
- }
-
- private static bool Unprocessed (ICollection extra, Option def, OptionContext c, string argument)
- {
- if (def == null) {
- extra.Add (argument);
- return false;
- }
- c.OptionValues.Add (argument);
- c.Option = def;
- c.Option.Invoke (c);
- return false;
- }
-
- private readonly Regex ValueOption = new Regex (
- @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$");
-
- protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value)
- {
- if (argument == null)
- throw new ArgumentNullException ("argument");
-
- flag = name = sep = value = null;
- Match m = ValueOption.Match (argument);
- if (!m.Success) {
- return false;
- }
- flag = m.Groups ["flag"].Value;
- name = m.Groups ["name"].Value;
- if (m.Groups ["sep"].Success && m.Groups ["value"].Success) {
- sep = m.Groups ["sep"].Value;
- value = m.Groups ["value"].Value;
- }
- return true;
- }
-
- protected virtual bool Parse (string argument, OptionContext c)
- {
- if (c.Option != null) {
- ParseValue (argument, c);
- return true;
- }
-
- string f, n, s, v;
- if (!GetOptionParts (argument, out f, out n, out s, out v))
- return false;
-
- Option p;
- if (Contains (n)) {
- p = this [n];
- c.OptionName = f + n;
- c.Option = p;
- switch (p.OptionValueType) {
- case OptionValueType.None:
- c.OptionValues.Add (n);
- c.Option.Invoke (c);
- break;
- case OptionValueType.Optional:
- case OptionValueType.Required:
- ParseValue (v, c);
- break;
- }
- return true;
- }
- // no match; is it a bool option?
- if (ParseBool (argument, n, c))
- return true;
- // is it a bundled option?
- if (ParseBundledValue (f, string.Concat (n + s + v), c))
- return true;
-
- return false;
- }
-
- private void ParseValue (string option, OptionContext c)
- {
- if (option != null)
- foreach (string o in c.Option.ValueSeparators != null
- ? option.Split (c.Option.ValueSeparators, c.Option.MaxValueCount - c.OptionValues.Count, StringSplitOptions.None)
- : new string[]{option}) {
- c.OptionValues.Add (o);
- }
- if (c.OptionValues.Count == c.Option.MaxValueCount ||
- c.Option.OptionValueType == OptionValueType.Optional)
- c.Option.Invoke (c);
- else if (c.OptionValues.Count > c.Option.MaxValueCount) {
- throw new OptionException (localizer (string.Format (
- "Error: Found {0} option values when expecting {1}.",
- c.OptionValues.Count, c.Option.MaxValueCount)),
- c.OptionName);
- }
- }
-
- private bool ParseBool (string option, string n, OptionContext c)
- {
- Option p;
- string rn;
- if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') &&
- Contains ((rn = n.Substring (0, n.Length-1)))) {
- p = this [rn];
- string v = n [n.Length-1] == '+' ? option : null;
- c.OptionName = option;
- c.Option = p;
- c.OptionValues.Add (v);
- p.Invoke (c);
- return true;
- }
- return false;
- }
-
- private bool ParseBundledValue (string f, string n, OptionContext c)
- {
- if (f != "-")
- return false;
- for (int i = 0; i < n.Length; ++i) {
- Option p;
- string opt = f + n [i].ToString ();
- string rn = n [i].ToString ();
- if (!Contains (rn)) {
- if (i == 0)
- return false;
- throw new OptionException (string.Format (localizer (
- "Cannot bundle unregistered option '{0}'."), opt), opt);
- }
- p = this [rn];
- switch (p.OptionValueType) {
- case OptionValueType.None:
- Invoke (c, opt, n, p);
- break;
- case OptionValueType.Optional:
- case OptionValueType.Required: {
- string v = n.Substring (i+1);
- c.Option = p;
- c.OptionName = opt;
- ParseValue (v.Length != 0 ? v : null, c);
- return true;
- }
- default:
- throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType);
- }
- }
- return true;
- }
-
- private static void Invoke (OptionContext c, string name, string value, Option option)
- {
- c.OptionName = name;
- c.Option = option;
- c.OptionValues.Add (value);
- option.Invoke (c);
- }
-
- private const int OptionWidth = 29;
- private const int Description_FirstWidth = 80 - OptionWidth;
- private const int Description_RemWidth = 80 - OptionWidth - 2;
-
- public void WriteOptionDescriptions (TextWriter o)
- {
- foreach (Option p in this) {
- int written = 0;
-
- if (p.Hidden)
- continue;
-
- Category c = p as Category;
- if (c != null) {
- WriteDescription (o, p.Description, "", 80, 80);
- continue;
- }
-
- if (!WriteOptionPrototype (o, p, ref written))
- continue;
-
- if (written < OptionWidth)
- o.Write (new string (' ', OptionWidth - written));
- else {
- o.WriteLine ();
- o.Write (new string (' ', OptionWidth));
- }
-
- WriteDescription (o, p.Description, new string (' ', OptionWidth+2),
- Description_FirstWidth, Description_RemWidth);
- }
-
- foreach (ArgumentSource s in sources) {
- string[] names = s.GetNames ();
- if (names == null || names.Length == 0)
- continue;
-
- int written = 0;
-
- Write (o, ref written, " ");
- Write (o, ref written, names [0]);
- for (int i = 1; i < names.Length; ++i) {
- Write (o, ref written, ", ");
- Write (o, ref written, names [i]);
- }
-
- if (written < OptionWidth)
- o.Write (new string (' ', OptionWidth - written));
- else {
- o.WriteLine ();
- o.Write (new string (' ', OptionWidth));
- }
-
- WriteDescription (o, s.Description, new string (' ', OptionWidth+2),
- Description_FirstWidth, Description_RemWidth);
- }
- }
-
- void WriteDescription (TextWriter o, string value, string prefix, int firstWidth, int remWidth)
- {
- bool indent = false;
- foreach (string line in GetLines (localizer (GetDescription (value)), firstWidth, remWidth)) {
- if (indent)
- o.Write (prefix);
- o.WriteLine (line);
- indent = true;
- }
- }
-
- bool WriteOptionPrototype (TextWriter o, Option p, ref int written)
- {
- string[] names = p.Names;
-
- int i = GetNextOptionIndex (names, 0);
- if (i == names.Length)
- return false;
-
- if (names [i].Length == 1) {
- Write (o, ref written, " -");
- Write (o, ref written, names [0]);
- }
- else {
- Write (o, ref written, " --");
- Write (o, ref written, names [0]);
- }
-
- for ( i = GetNextOptionIndex (names, i+1);
- i < names.Length; i = GetNextOptionIndex (names, i+1)) {
- Write (o, ref written, ", ");
- Write (o, ref written, names [i].Length == 1 ? "-" : "--");
- Write (o, ref written, names [i]);
- }
-
- if (p.OptionValueType == OptionValueType.Optional ||
- p.OptionValueType == OptionValueType.Required) {
- if (p.OptionValueType == OptionValueType.Optional) {
- Write (o, ref written, localizer ("["));
- }
- Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description)));
- string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0
- ? p.ValueSeparators [0]
- : " ";
- for (int c = 1; c < p.MaxValueCount; ++c) {
- Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description)));
- }
- if (p.OptionValueType == OptionValueType.Optional) {
- Write (o, ref written, localizer ("]"));
- }
- }
- return true;
- }
-
- static int GetNextOptionIndex (string[] names, int i)
- {
- while (i < names.Length && names [i] == "<>") {
- ++i;
- }
- return i;
- }
-
- static void Write (TextWriter o, ref int n, string s)
- {
- n += s.Length;
- o.Write (s);
- }
-
- private static string GetArgumentName (int index, int maxIndex, string description)
- {
- if (description == null)
- return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
- string[] nameStart;
- if (maxIndex == 1)
- nameStart = new string[]{"{0:", "{"};
- else
- nameStart = new string[]{"{" + index + ":"};
- for (int i = 0; i < nameStart.Length; ++i) {
- int start, j = 0;
- do {
- start = description.IndexOf (nameStart [i], j);
- } while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false);
- if (start == -1)
- continue;
- int end = description.IndexOf ("}", start);
- if (end == -1)
- continue;
- return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length);
- }
- return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
- }
-
- private static string GetDescription (string description)
- {
- if (description == null)
- return string.Empty;
- StringBuilder sb = new StringBuilder (description.Length);
- int start = -1;
- for (int i = 0; i < description.Length; ++i) {
- switch (description [i]) {
- case '{':
- if (i == start) {
- sb.Append ('{');
- start = -1;
- }
- else if (start < 0)
- start = i + 1;
- break;
- case '}':
- if (start < 0) {
- if ((i+1) == description.Length || description [i+1] != '}')
- throw new InvalidOperationException ("Invalid option description: " + description);
- ++i;
- sb.Append ("}");
- }
- else {
- sb.Append (description.Substring (start, i - start));
- start = -1;
- }
- break;
- case ':':
- if (start < 0)
- goto default;
- start = i + 1;
- break;
- default:
- if (start < 0)
- sb.Append (description [i]);
- break;
- }
- }
- return sb.ToString ();
- }
-
- private static IEnumerable GetLines (string description, int firstWidth, int remWidth)
- {
- return StringCoda.WrappedLines (description, firstWidth, remWidth);
- }
- }
-}
-
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/License.txt b/packages/Saltarelle.Compiler.3.0-alpha-0001/License.txt
deleted file mode 100644
index ae7144c..0000000
--- a/packages/Saltarelle.Compiler.3.0-alpha-0001/License.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
- http://www.apache.org/licenses/LICENSE-2.0
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/Saltarelle.Compiler.3.0-alpha-0001.nupkg b/packages/Saltarelle.Compiler.3.0-alpha-0001/Saltarelle.Compiler.3.0-alpha-0001.nupkg
deleted file mode 100644
index 8bc50fe..0000000
Binary files a/packages/Saltarelle.Compiler.3.0-alpha-0001/Saltarelle.Compiler.3.0-alpha-0001.nupkg and /dev/null differ
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/content/dummy.txt b/packages/Saltarelle.Compiler.3.0-alpha-0001/content/dummy.txt
deleted file mode 100644
index 6892001..0000000
--- a/packages/Saltarelle.Compiler.3.0-alpha-0001/content/dummy.txt
+++ /dev/null
@@ -1 +0,0 @@
-This file is safe to remove from the project, but NuGet requires the Saltarelle.Compiler package to install something.
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/history.txt b/packages/Saltarelle.Compiler.3.0-alpha-0001/history.txt
deleted file mode 100644
index ba8412c..0000000
--- a/packages/Saltarelle.Compiler.3.0-alpha-0001/history.txt
+++ /dev/null
@@ -1,266 +0,0 @@
-2.5.0
-Awaiting a task throws the inner exception rather than the AggregateException of the task, as in .net (#294).
-Created a [BackingFieldName] attribute that can be used to specify the name of the backing field for an automatically implemented property or event.
-BREAKING CHANGE: [IntrinsicProperty] no longer implies [PreserveName]
-Added a [CustomInitializationAttribute] that allows custom initialization to be specified for fields (including the backing fields of properties and events)
-Fixed issue with Object.keys being used before it was defined on browsers that don't support it natively (or if a polyfill was already included) (#276)
-BREAKING CHANGE: Removed Array.prototype.filter, forEach and every from mscorlib. Use some other polyfill if you need these (#276).
-Fixed comparison of null values using Comparer.Default (#279)
-Support for user-defined value types (#146)
-Fixed problem with method group conversions on static methods implemented as inline code (#281)
-Fixed problem overriding members that implement interface methods implemented as inline code with a generated method (#272)
-Fixed problem with empty ScriptName and ExpandParams (#264)
-Fixed reflection for members of interfaces (#267)
-Fixed issue causing param arrays to sometimes be created multiple times (#268)
-Better extensibility for the OOP emulator. This can enable lots of cool import libs.
-Allow empty [ScriptName] on static methods (#258).
-Fixed issue causing compiler error with await in if with empty else block (#259).
-Fixed issue overriding toString and other issues caused by the DontEnum bug in IE<9 (#260).
-
-2.4.0
-Fixed issue causing [NamedValues] enums not to work correctly when used as generic arguments (#256)
-Corrected DateTime.UtcNow and added DateTime.ToLocalTime and DateTime.ToUniversal (#250)
-Support escaped braces ({{, }}) in format strings (#252)
-Added possibility to embed resources in the generated script (Assembly.GetManifestResourceNames, Assembly.GetManifestResourceData).
-Added Environment.NewLine
-Added methods Convert.FromBase64String and Convert.ToBase64String
-BREAKING CHANGE: Type.GetType("TypeName, AssemblyName") will now only scan loaded assemblies. Additional assemblies can be loaded using Assembly.Load(). Type.GetType("TypeName") works like before.
-Fixed issue comparing a nullable type parameter to null (#247)
-Added basic Assembly and AppDomain classes (#210)
-[Serializable] types can now declare indexers, as long as they have one parameter (#233)
-Fixed problem when a name imported by the linker clashed with a variable name (eg. when importing a class named 'd3') (#94, #245)
-Fixed a few issues causing internal errors when using generics (#235, 236)
-
-2.3.1
-Added type NotImplementedException
-Fixed problem with assembly-level attributes on imported assemblies (#232).
-
-2.3.0
-Integer division by zero will now throw DivideByZeroException.
-Removed (actually: obsoleted as errors) the Script# reflection methods. Some of the functionality can now be found in the Script class, but some was just removed.
-Type system now supports interface variance (eg. IMyInterface).
-Use real prototype inheritance instead of the homegrown __baseType hack.
-Ensured .NET semantics for String.Split methods that take a limit argument (#229). The JS semantics can be found in methods called JsSplit. This might cause compilation errors, but it will not silently break any code.
-Fixed TimeSpan.Zero (#227)
-Added [DefaultMemberReflectabilityAttribute] to specify which members are reflectable by default (#180)
-Added types Stopwatch and IFormatProvider, and added some overloads of String.Split (thanks to Marcel F)
-typeof(int?).GetGenericArguments() now returns int as in .net. Also improved the use of nullables as type arguments (#192)
-Added missing TimeSpan members (#215)
-Fixed internal error when overriding virtual members that implement [NonScriptable] interface members (#218)
-Fixed problem with base types not being initialized before derived types in certain cases including generic types in the chain (#222)
-Custom class attributes no longer need to qualify nested classes (#224)
-Fixed issues with double and float constants misbehaving in minified scripts (#208)
-NoInlineAttribute can now be applied to const fields to prevent them from being inlined in minified scripts.
-BREAKING CHANGE: double.MinValue now returns the value expected in .net (approx -1.7e-308) instead of the one in JS (Number.MIN_VALUE = 5e-324). JsMinValue exists to return Number.MIN_VALUE.
-Allow statements (any number of them) in inline code for methods returning void (#149)
-Enabled the use of JS reserved words as member names in inline code (#204)
-Fixed problem using anonymous methods in [Mixin] classes (#216)
-Casts to [NamedValues] enums are now treated as casts to string (#214)
-Use strict mode in generated assemblies as well as in mscorlib (#194)
-Implemented type System.Guid, using a string as the backing store (thanks to Valeriob)
-Added many standard .net exception types
-Fixed a few issues caused by 'dynamic' and 'object' not being treated as the same type when they should be (#202, #209)
-Added an AdditionalDependencyAttribute that can be used to specify additional dependencies to be imported by an assembly (thanks to Michael Busby)
-Fixed issue with reflectable knockout properties (#189)
-Allow empty script name for types in modules (#181)
-Fixed error compiling with Visual Studio if VSCommands is installed (#151)
-Fixed issue causing generic types with different type arguments to (occasionally) be treated as the same type when used as a base type (#186).
-
-2.2.0
-Added metadata for typed arrays.
-Added possibility to specify alternative inline code when a method is being invoked in non-expanded form, and used that to ensure all RTL methods can be invoked in non-expanded form (#177).
-Fixed method group conversions on extension methods (#176).
-Make sure additional files are copied to the output directory in order to avoid unnecessary rebuilds (#172).
-Fixed bug in the 'C' number format.
-All constructors for [Imported] types are now treated as unnamed constructors unless a [ScriptName] is specified for them (#164).
-Applying a [ScriptNameAttribute] to an [Imported] enum will now cause the fields of the enum to be treated as field access on the type (#160).
-
-2.1.0
-Added class HttpUtility
-It is now an error to use the 'is' and 'as' operators with types that don't obey the type system.
-Allow parameters for ObjectLiteral constructors to be a type derived from the initialized member or a non-nullable version of a nullable member.
-Fixed issue when a local variable is called 'ss' (#154)
-Added types System.TimeSpan, System.Random (thanks to Marcel F)
-Implemented support for expression trees.
-Interfaces can now be serializable (#106)
-BREAKING CHANGE: Math.Round now uses C# semantics (RoundToEven). To get JS semantics (round up), use Math.JsRound.
-ScriptSkipAttribute can now be specified to constructors to indicate that the constructor call will be skipped when used as a constructor initializer (": base()" or ": this()")
-More .net string and Math methods (thanks to Marcel F)
-Implemented .net reflection API (#125)
-Support [InlineCode] on property accessors on serializable types
-
-2.0.4
-Fixed bug generating async methods with return statements inside nested blocks (#143)
-
-2.0.3
-Fixed bug causing invalid code being generated for async methods when a try block is the first statement inside a nested block (#141)
-
-2.0.2
-Fixed problems causing @-signs to appear in verbatim identifiers (eg. public int @event).
-Hopefully this time fixed issue running sc.exe in Mono (#131)
-Added interface IFormattable and used that to fix String.Format with custom format (#133)
-
-2.0.1
-Added types IComparer and Comparer (#130)
-Fixed issue running sc.exe in Mono (#131)
-
-2.0.0
-Fixed issue with labels in switch section bodies (#128)
-Support using the params parameter in [ExpandParams] methods and allow [ExpandParams] methods to be called in non-expanded form.
-Created a MinimizePublicNamesAttribute that can be used to specify that public members are minified in addition to non-public ones (#84).
-Fixed issue causing internal errors when compiling async methods with certain constructs.
-Added IncludeGenericArgumentsDefaultAttribute to specify default values for IncludeGenericArguments in an assembly.
-Added IncludeGenericArgumentsAttribute and removed IgnoreGenericArgumentsAttribute. For the IgnoreGenericArguments effect, use IncludeGenericArguments(false).
-Use Object.Equals() in ICollection methods Contains, IndexOf, Remove of collections and arrays.
-mscorlib.js no longer extends any built-in object. The only global pollution is a single global object called 'ss'.
- This is a breaking change for manually written Javascript that depends on mscorlib, but should not affect compiled code.
-BREAKING CHANGE: System.DateTime now uses one-based months. System.JsDate uses zero-based months (#116)
-BREAKING CHANGE: String.Substring now matches .net semantics (start/count). If you want JS semantics (start/end), use String.JsSubstring (#117).
-Replaced AsyncTestAttribute with an IsAsync property on TestAttribute.
-Moved QUnit import library into the assembly Saltarelle.QUnit. Moved all QUnit classes to the namespace QUnit.
-The compilation process is now pluggable.
-Added InlineConstantAttribute and converted a bunch of static properties in the runtime to inline constants.
-Added interfaces IComparable, IEquatable.
-Dictionary now supports a custom EqualityComparer.
-Support invoking and overriding object.Equals and object.GetHashCode
-Created type System.Lazy
-
-1.7.1
-No longer allows "string s = (string)65"
-Fixed error causing type initializers to be invoked in the opposite order to what they should (#96)
-
-1.7.0
-Added heuristic to run type initializers in the correct order (#96)
-Fixed issue with the casing of some jQueryUI widgets (#107)
-Fixed issue using object initializers when creating instances of type parameters (#111).
-Fixed issue with [InlineCode("new a.b()")] (#109)
-Fixed issue (sometimes) causing errors when deriving from a nested type (#108)
-Added static methods Object.Keys and Object.GetOwnPropertyNames
-Fixed issue with KeyValuePair constructors (#112)
-Added parameterless versions of ObservableArray.RemoveAll and ObservableArray.DestroyAll (#104).
-Fixed internal error when using the result of dynamic method calls in certain invalid ways (#105).
-Generate all code inside an anonymous function when not using a module loader (#99).
-Fixed issue causing incorrect code to be generated when the variable declared by a foreach() loop was used by reference.
-Fixed issue causing ref and out parameters to anonymous methods and lambdas not to work (#98).
-
-1.6.3
-Fixed issues with user-defined conversion operators (#97)
-Knockout API updates
-Fixed issue invoking static method with dynamic argument (#95)
-
-1.6.2
-Throw an exception if any index in a multidimensional array access is out of range (#79)
-Fixed issue with Dispose() method for iterator blocks.
-
-1.6.1
-Fixed an issue causing the state machine rewriter to generate incorrect code
-Added interfaces IEquatable and IHashable
-Created a "real" dictionary class that actually uses GetHashCode() and Equals().
-
-1.5.2
-Don't swallow exceptions in async void methods.
-Fixed assigning to the backing field of an event.
-Fixed issue using async methods in certain cases when not using the VS .targets file.
-The variable declared in a foreach statement is now considered declared inside the loop (only matters when capturing it, breaking change in C#5.0)
-Fixed issue causing the "N" format specifier to forget the minus sign for small negative numbers.
-
-1.5.1
-Fixed issue using "this" in async methods.
-
-1.5.0
-Added Support for AMD (AsyncModuleAttribute)
-Added support for generating executables, which will invoke the static Main entry point (command line -t:exe, task property TargetType).
-Allow invalid identifiers in [ScriptName] and similar attribute. This will generate indexing expressions rather than dot-notation for those members.
-foreach over ElementCollection and List will now use a for loop. The [EnumerateAsArrayAttribute] controls this behaviour.
-Casting undefined to another type now returns undefined (instead of throwing an error).
-Can now specify PreseveMemberCase(false) on types to ignore the effect of a PreserveMemberCaseAttribute on the assembly.
-Node.js support: mscorlib works in Node, and there is a Node.js import library.
-Allow members other than methods in [GlobalMethods] classes. All members in such classes will be treated as gloabls (or module globals).
-Added support for CommonJS require
-
-1.4.0
-Implemented support for async/await.
-Fixed problem assigning an object creation with initializers to a by-reference variable.
-Fixed problems causing compilation error when using a default constructor constarint on a type parameter.
-Fixed invoking method implemented as inline code with type parameters as type arguments.
-Can now specify custom implementations for methods/properties that override/implement [NonScriptable] base members.
-Fixed bug when assigning to a property of type dynamic when the property owner is not dynamic.
-Fixed error when using 'x is Function'
-Array utility methods are now typed extension methods in the System namespace rather than untyped instance methods on Array.
-Fixed issue causing Type.cast calls to be generated for [Imported] generic types.
-Fixed type ordering issue when inheriting from a type that uses [IgnoreGenericArguments].
-Support multidimensional arrays.
-Fixed ordering of type to prevent unnecessary (and sometimes problematic) Type.registerNamespace calls
-
-1.3.0
-Support empty ScriptName for NamedValues enum.
-Added MinValue/MaxValue members to integer types.
-Added members necessary to compile iterator blocks returning IEnumerable.
-Fixed internal error when inheriting from generic type.
-Added conditions to project imports to work with NuGet package restore.
-Fixed problem invoking method on a class decorated with a [MixinAttribute].
-Fixed compilation of expression lambda containing a single property assignment.
-Fixed issue causing the property assignment to erroneously happen unconditionally in the statements "a && (P = b)" and "a || (P = b)".
-Conditional expressions now only declare the temporary variable once.
-Ensure that the RHS of a coalescing operator is not evaluated if the LHS is null
-Added support for [ExpandParams] and [BindThisToFirstParameter] attributes on delegates.
-
-1.2.5
-Refactored the handling of inline code. This means that unnecessary parentheses should no longer appear when using certain methods. It also means that the {,arg} modifier is removed ({*arg} now knows what to do), and inline code is verified to be syntactically valid.
-Re-added types Queue and Stack to the RTL
-
-1.2.4
-ImportedAttribute now also counts as IgnoreGenericArgument by default (Script# compatibility issue).
-Fixed an issue causing object initializers to be ignored for constructors defined as inline code.
-Fixed issue causing enum fields not to be included in the enum type.
-
-1.2.3
-Fixed metadata bug causing jQuery.ExtendXX methods not to work
-Added a PreserveMemberCaseAttribute that can be used to prevent camel-casing of members in an assembly or a type.
-
-1.2.2
-Conversions between JsDate and DateTime are now explicit. Should solve issues involving nullable DateTimes.
-
-1.2.1
-Support constructors with a single 'params object[]' parameter for imported types to create a name-value collection.
-Renamed MutableDateTime to JsDate.
-Fixed issue causing instantiation of generic types with named constructors to not work (#18).
-
-1.2.0
-Fixed compiling instance methods on serializable types.
-Insert parentheses around number when a member is being accessed (eg. (1).member).
-Removed implicit conversion of char to string because that caused issues with csc. Added error message when char is boxed because this is very unlikely to yield undesired behaviour.
-Serializable types no longer have to be sealed (but they still cannot use virtual/override)
-Fixed issue with Visual Studio IntelliSense
-Fixed issue that causes s.IndexOf("x", 1) to be compiled to s.indexOf(String.fromCharCode('/'), 1)
-Fixed issue using static members through subclasses of the declaring type.
-Added new assembly-level ScriptSharpCompatibiliyAttribute.
-Added equality and inequality operators to System.DateTime.
-Some fixes to System.String
-
-1.1.4
-Fixed NuGet dependency versions. Installing Runtime will now always install the latest version of the compiler and so on.
-
-1.1.3
-Fixed issue cloning generic delegates (eg. Func, Action).
-
-1.1.2
-Fixed issue causing incorrect code to be generated when duplicate using directives were specified. Also added code to ensure an internal error is raised under similar circumstances.
-RegexMatch has a Length property and is convertible to string[]
-DateTime.ParseExact and ParseExactUtc metadata updated to return DateTime? (which they always actually have in script)
-
-1.1.1
-Added type NotSupportedException (required for the iterator blocks feature).
-
-1.1.0
-Use !! for dynamic conversions to bool.
-Fixed internal error when implementing properties/events that are [NonScriptable]
-Implemented support for iterator blocks (yield)
-Minification improvements
-DateTime is now an immutable struct, MutableDateTime is a mutable date class.
-
-1.0.1
-Fixed project URL and included history in NuGet packages.
-
-1.0.0
-Initial version
\ No newline at end of file
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/SCTask.dll b/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/SCTask.dll
deleted file mode 100644
index 5a64cb4..0000000
Binary files a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/SCTask.dll and /dev/null differ
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/Saltarelle.Compiler.targets b/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/Saltarelle.Compiler.targets
deleted file mode 100644
index 3bc5dbb..0000000
--- a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/Saltarelle.Compiler.targets
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
- true
-
-
- true
-
-
-
-
-
-
-
-
-
- false
-
-
-
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/install.ps1 b/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/install.ps1
deleted file mode 100644
index d95ba3d..0000000
--- a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/install.ps1
+++ /dev/null
@@ -1,49 +0,0 @@
-Param($installPath, $toolsPath, $package, $project)
-
-Function MakeRelativePath($Origin, $Target) {
- $originUri = New-Object Uri('file://' + $Origin)
- $targetUri = New-Object Uri('file://' + $Target)
- $originUri.MakeRelativeUri($targetUri).ToString().Replace('/', [System.IO.Path]::DirectorySeparatorChar)
-}
-
-Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
-$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
-
-# Set the NoStdLib property. Not that we need it, but other tools (eg. ReSharper) will have use for it.
-$msbuild.SetProperty("NoStdLib", "True")
-
-#Set the target framework to v2.0, otherwise we will have two System.Linq if installing the Linq package.
-$msbuild.SetProperty("TargetFrameworkVersion", "v2.0")
-
-# Remove default assemblies System, System.*, Microsoft.*
-$project.Object.References | ? { $_.Name.StartsWith("System.") } | % { try { $_.Remove() } catch {} }
-$project.Object.References | ? { $_.Name -eq "System" } | % { $_.Remove() }
-$project.Object.References | ? { $_.Name.StartsWith("Microsoft.") } | % { $_.Remove() }
-
-# Swap the import for Microsoft.CSharp.targets for Saltarelle.Compiler.targets. Also remove any existing reference to Saltarelle.Compiler.targets since we might be upgrading.
-# Ensure that the new import appears in the same place in the project file as the old one.
-$toRemove = $msbuild.Xml.Imports | ? { $_.Project.EndsWith("Saltarelle.Compiler.targets") -or $_.Project.EndsWith("Microsoft.CSharp.targets") }
-$newLocation = $toRemove | Select-Object -First 1
-if (-not $newLocation) {
- $newLocation = $msbuild.Xml.Imports | Select-Object -First 1
- if (-not $newLocation) {
- $newLocation = $msbuild.Xml.Children | Select-Object -Last 1
- }
-}
-$newImportPath = "`$(SolutionDir)$(MakeRelativePath -Origin $project.DTE.Solution.FullName -Target ([System.IO.Path]::Combine($toolsPath, ""Saltarelle.Compiler.targets"")))"
-$newImport = $msbuild.Xml.CreateImportElement($newImportPath)
-$newImport.Condition = "Exists('$newImportPath')"
-$newImportCSharp = $msbuild.Xml.CreateImportElement("`$(MSBuildToolsPath)\Microsoft.CSharp.targets")
-$newImportCSharp.Condition = "!Exists('$newImportPath')"
-
-$msbuild.Xml.InsertAfterChild($newImport, $newLocation)
-$msbuild.Xml.InsertAfterChild($newImportCSharp, $newLocation)
-
-if ($toRemove) {
- $toRemove | % { $msbuild.Xml.RemoveChild($_) }
-}
-
-# Remove the dummy file we have to create in order to have our installer being called by NuGet
-$project.ProjectItems | ? { $_.Name -eq "dummy.txt" } | % { $_.Delete() }
-
-$project.Save()
\ No newline at end of file
diff --git a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/sc.exe b/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/sc.exe
deleted file mode 100644
index df86624..0000000
Binary files a/packages/Saltarelle.Compiler.3.0-alpha-0001/tools/sc.exe and /dev/null differ
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/License.txt b/packages/Saltarelle.Runtime.3.0-alpha-0002/License.txt
deleted file mode 100644
index ae7144c..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/License.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
- http://www.apache.org/licenses/LICENSE-2.0
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/Saltarelle.Runtime.3.0-alpha-0002.nupkg b/packages/Saltarelle.Runtime.3.0-alpha-0002/Saltarelle.Runtime.3.0-alpha-0002.nupkg
deleted file mode 100644
index 6b46406..0000000
Binary files a/packages/Saltarelle.Runtime.3.0-alpha-0002/Saltarelle.Runtime.3.0-alpha-0002.nupkg and /dev/null differ
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/content/dummy.txt b/packages/Saltarelle.Runtime.3.0-alpha-0002/content/dummy.txt
deleted file mode 100644
index 6892001..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/content/dummy.txt
+++ /dev/null
@@ -1 +0,0 @@
-This file is safe to remove from the project, but NuGet requires the Saltarelle.Compiler package to install something.
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.js b/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.js
deleted file mode 100644
index a13049c..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.js
+++ /dev/null
@@ -1,3845 +0,0 @@
-// SaltarelleCompiler Runtime (http://www.saltarelle-compiler.com)
-// Modified version of Script# Core Runtime (http://projects.nikhilk.net/ScriptSharp)
-
-if (typeof(global) === "undefined") {
- if (typeof(window) !== "undefined")
- global = window;
- else if (typeof(self) !== "undefined")
- global = self;
-}
-(function(global) {
-"use strict";
-
-var ss = { __assemblies: {} };
-
-ss.initAssembly = function assembly(obj, name, res) {
- res = res || {};
- obj.name = name;
- obj.toString = function() { return this.name; };
- obj.__types = {};
- obj.getResourceNames = function() { return Object.keys(res); };
- obj.getResourceDataBase64 = function(name) { return res[name] || null; };
- obj.getResourceData = function(name) { var r = res[name]; return r ? ss.dec64(r) : null; };
- ss.__assemblies[name] = obj;
-};
-ss.initAssembly(ss, 'mscorlib');
-
-ss.load = function ss$load(name) {
- return ss.__assemblies[name] || require(name);
-};
-
-var enc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', dec;
-ss.enc64 = function(a, b) {
- var s = '', i;
- for (i = 0; i < a.length; i += 3) {
- var c1 = a[i], c2 = a[i+1], c3 = a[i+2];
- s += (b && i && !(i%57) ? '\n' : '') + enc[c1 >> 2] + enc[((c1 & 3) << 4) | (c2 >> 4)] + (i < a.length - 1 ? enc[((c2 & 15) << 2) | (c3 >> 6)] : '=') + (i < a.length - 2 ? enc[c3 & 63] : '=');
- }
- return s;
-};
-
-ss.dec64 = function(s) {
- s = s.replace(/\s/g, '');
- dec = dec || (function() { var o = {'=':-1}; for (var i = 0; i < 64; i++) o[enc[i]] = i; return o; })();
- var a = Array(Math.max(s.length * 3 / 4 - 2, 0)), i;
- for (i = 0; i < s.length; i += 4) {
- var j = i * 3 / 4, c1 = dec[s[i]], c2 = dec[s[i+1]], c3 = dec[s[i+2]], c4 = dec[s[i+3]];
- a[j] = (c1 << 2) | (c2 >> 4);
- if (c3 >= 0) a[j+1] = ((c2 & 15) << 4) | (c3 >> 2);
- if (c4 >= 0) a[j+2] = ((c3 & 3) << 6) | c4;
- }
- return a;
-};
-
-ss.getAssemblies = function ss$getAssemblies() {
- return Object.keys(ss.__assemblies).map(function(n) { return ss.__assemblies[n]; });
-};
-
-ss.isNullOrUndefined = function ss$isNullOrUndefined(o) {
- return (o === null) || (o === undefined);
-};
-
-ss.isValue = function ss$isValue(o) {
- return (o !== null) && (o !== undefined);
-};
-
-ss.referenceEquals = function ss$referenceEquals(a, b) {
- return ss.isValue(a) ? a === b : !ss.isValue(b);
-};
-
-ss.mkdict = function ss$mkdict() {
- var a = (arguments.length != 1 ? arguments : arguments[0]);
- var r = {};
- for (var i = 0; i < a.length; i += 2) {
- r[a[i]] = a[i + 1];
- }
- return r;
-};
-
-ss.coalesce = function ss$coalesce(a, b) {
- return ss.isValue(a) ? a : b;
-};
-
-ss.isDate = function ss$isDate(obj) {
- return Object.prototype.toString.call(obj) === '[object Date]';
-};
-
-ss.isArray = function ss$isArray(obj) {
- return Object.prototype.toString.call(obj) === '[object Array]';
-};
-
-ss.isTypedArrayType = function ss$isTypedArrayType(type) {
- return ['Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Uint8ClampedArray'].indexOf(ss.getTypeFullName(type)) >= 0;
-};
-
-ss.isArrayOrTypedArray = function ss$isArray(obj) {
- return ss.isArray(obj) || ss.isTypedArrayType(ss.getInstanceType(obj));
-};
-
-ss.getHashCode = function ss$getHashCode(obj) {
- if (!ss.isValue(obj))
- throw new ss_NullReferenceException('Cannot get hash code of null');
- else if (typeof(obj.getHashCode) === 'function')
- return obj.getHashCode();
- else if (typeof(obj) === 'boolean') {
- return obj ? 1 : 0;
- }
- else if (typeof(obj) === 'number') {
- var s = obj.toExponential();
- s = s.substr(0, s.indexOf('e'));
- return parseInt(s.replace('.', ''), 10) & 0xffffffff;
- }
- else if (typeof(obj) === 'string') {
- var res = 0;
- for (var i = 0; i < obj.length; i++)
- res = (res * 31 + obj.charCodeAt(i)) & 0xffffffff;
- return res;
- }
- else if (ss.isDate(obj)) {
- return obj.valueOf() & 0xffffffff;
- }
- else {
- return ss.defaultHashCode(obj);
- }
-};
-
-ss.defaultHashCode = function ss$defaultHashCode(obj) {
- return obj.$__hashCode__ || (obj.$__hashCode__ = (Math.random() * 0x100000000) | 0);
-};
-
-ss.equals = function ss$equals(a, b) {
- if (!ss.isValue(a))
- throw new ss_NullReferenceException('Object is null');
- else if (a !== ss && typeof(a.equals) === 'function')
- return a.equals(b);
- if (ss.isDate(a) && ss.isDate(b))
- return a.valueOf() === b.valueOf();
- else if (typeof(a) === 'function' && typeof(b) === 'function')
- return ss.delegateEquals(a, b);
- else if (ss.isNullOrUndefined(a) && ss.isNullOrUndefined(b))
- return true;
- else
- return a === b;
-};
-
-ss.compare = function ss$compare(a, b) {
- if (!ss.isValue(a))
- throw new ss_NullReferenceException('Object is null');
- else if (typeof(a) === 'number' || typeof(a) === 'string' || typeof(a) === 'boolean')
- return a < b ? -1 : (a > b ? 1 : 0);
- else if (ss.isDate(a))
- return ss.compare(a.valueOf(), b.valueOf());
- else
- return a.compareTo(b);
-};
-
-ss.equalsT = function ss$equalsT(a, b) {
- if (!ss.isValue(a))
- throw new ss_NullReferenceException('Object is null');
- else if (typeof(a) === 'number' || typeof(a) === 'string' || typeof(a) === 'boolean')
- return a === b;
- else if (ss.isDate(a))
- return a.valueOf() === b.valueOf();
- else
- return a.equalsT(b);
-};
-
-ss.staticEquals = function ss$staticEquals(a, b) {
- if (!ss.isValue(a))
- return !ss.isValue(b);
- else
- return ss.isValue(b) ? ss.equals(a, b) : false;
-};
-
-ss.shallowCopy = function ss$shallowCopy(source, target) {
- var keys = Object.keys(source);
- for (var i = 0, l = keys.length; i < l; i++) {
- var k = keys[i];
- target[k] = source[k];
- }
-};
-
-ss.isLower = function ss$isLower(c) {
- var s = String.fromCharCode(c);
- return s === s.toLowerCase() && s !== s.toUpperCase();
-};
-
-ss.isUpper = function ss$isUpper(c) {
- var s = String.fromCharCode(c);
- return s !== s.toLowerCase() && s === s.toUpperCase();
-};
-
-if (typeof(window) == 'object') {
- // Browser-specific stuff that could go into the Web assembly, but that assembly does not have an associated JS file.
- if (!window.Element) {
- // IE does not have an Element constructor. This implementation should make casting to elements work.
- window.Element = function() {};
- window.Element.isInstanceOfType = function(instance) { return instance && typeof instance.constructor === 'undefined' && typeof instance.tagName === 'string'; };
- }
- window.Element.__typeName = 'Element';
-
- if (!window.XMLHttpRequest) {
- window.XMLHttpRequest = function() {
- var progIDs = [ 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP' ];
-
- for (var i = 0; i < progIDs.length; i++) {
- try {
- var xmlHttp = new ActiveXObject(progIDs[i]);
- return xmlHttp;
- }
- catch (ex) {
- }
- }
-
- return null;
- };
- }
-
- ss.parseXml = function(markup) {
- try {
- if (DOMParser) {
- var domParser = new DOMParser();
- return domParser.parseFromString(markup, 'text/xml');
- }
- else {
- var progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ];
-
- for (var i = 0; i < progIDs.length; i++) {
- var xmlDOM = new ActiveXObject(progIDs[i]);
- xmlDOM.async = false;
- xmlDOM.loadXML(markup);
- xmlDOM.setProperty('SelectionLanguage', 'XPath');
- return xmlDOM;
- }
- }
- }
- catch (ex) {
- }
-
- return null;
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Object Extensions
-
-ss.clearKeys = function ss$clearKeys(d) {
- for (var n in d) {
- if (d.hasOwnProperty(n))
- delete d[n];
- }
-};
-
-ss.keyExists = function ss$keyExists(d, key) {
- return d[key] !== undefined;
-};
-
-if (!Object.keys) {
- Object.keys = (function() {
- 'use strict';
- var hasOwnProperty = Object.prototype.hasOwnProperty,
- hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
- dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'],
- dontEnumsLength = dontEnums.length;
-
- return function (obj) {
- if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
- throw new TypeError('Object.keys called on non-object');
- }
-
- var result = [], prop, i;
-
- for (prop in obj) {
- if (hasOwnProperty.call(obj, prop)) {
- result.push(prop);
- }
- }
-
- if (hasDontEnumBug) {
- for (i = 0; i < dontEnumsLength; i++) {
- if (hasOwnProperty.call(obj, dontEnums[i])) {
- result.push(dontEnums[i]);
- }
- }
- }
- return result;
- };
- }());
-}
-
-ss.getKeyCount = function ss$getKeyCount(d) {
- return Object.keys(d).length;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Type System Implementation
-
-ss.__genericCache = {};
-
-ss._makeGenericTypeName = function ss$_makeGenericTypeName(genericType, typeArguments) {
- var result = genericType.__typeName;
- for (var i = 0; i < typeArguments.length; i++)
- result += (i === 0 ? '[' : ',') + '[' + ss.getTypeQName(typeArguments[i]) + ']';
- result += ']';
- return result;
-};
-
-ss.makeGenericType = function ss$makeGenericType(genericType, typeArguments) {
- var name = ss._makeGenericTypeName(genericType, typeArguments);
- return ss.__genericCache[name] || genericType.apply(null, typeArguments);
-};
-
-ss.registerGenericClassInstance = function ss$registerGenericClassInstance(instance, genericType, typeArguments, members, baseType, interfaceTypes) {
- var name = ss._makeGenericTypeName(genericType, typeArguments);
- ss.__genericCache[name] = instance;
- instance.__typeName = name;
- instance.__genericTypeDefinition = genericType;
- instance.__typeArguments = typeArguments;
- ss.initClass(instance, genericType.__assembly, members, baseType(), interfaceTypes());
-};
-
-ss.registerGenericInterfaceInstance = function ss$registerGenericInterfaceInstance(instance, genericType, typeArguments, members, baseInterfaces) {
- var name = ss._makeGenericTypeName(genericType, typeArguments);
- ss.__genericCache[name] = instance;
- instance.__typeName = name;
- instance.__genericTypeDefinition = genericType;
- instance.__typeArguments = typeArguments;
- ss.initInterface(instance, genericType.__assembly, members, baseInterfaces());
-};
-
-ss.isGenericTypeDefinition = function ss$isGenericTypeDefinition(type) {
- return type.__isGenericTypeDefinition || false;
-};
-
-ss.getGenericTypeDefinition = function ss$getGenericTypeDefinition(type) {
- return type.__genericTypeDefinition || null;
-};
-
-ss.getGenericParameterCount = function ss$getGenericParameterCount(type) {
- return type.__typeArgumentCount || 0;
-};
-
-ss.getGenericArguments = function ss$getGenericArguments(type) {
- return type.__typeArguments || null;
-};
-
-ss.__anonymousCache = {};
-ss.anonymousType = function ss$anonymousType() {
- var members = Array.prototype.slice.call(arguments);
- var name = 'Anonymous<' + members.map(function(m) { return m[1] + ':' + ss.getTypeFullName(m[0]); }).join(',') + '>';
- var type = ss.__anonymousCache[name];
- if (!type) {
- var type = new Function(members.map(function(m) { return m[1]; }).join(','), members.map(function(m) { return 'this.' + m[1] + '=' + m[1] + ';'; }).join(''));
- type.__typeName = name;
- var infos = members.map(function(m) { return { name: m[1], typeDef: type, type: 16, returnType: m[0], getter: { name: 'get_' + m[1], typeDef: type, params: [], returnType: m[0], fget: m[1] } }; });
- infos.push({ name: '.ctor', typeDef: type, type: 1, params: members.map(function(m) { return m[0]; }) });
- type.__metadata = { members: infos };
- ss.__anonymousCache[name] = type;
- }
- return type;
-}
-
-ss.setMetadata = function ss$_setMetadata(type, metadata) {
- if (metadata.members) {
- for (var i = 0; i < metadata.members.length; i++) {
- var m = metadata.members[i];
- m.typeDef = type;
- if (m.adder) m.adder.typeDef = type;
- if (m.remover) m.remover.typeDef = type;
- if (m.getter) m.getter.typeDef = type;
- if (m.setter) m.setter.typeDef = type;
- }
- }
- type.__metadata = metadata;
- if (metadata.variance) {
- type.isAssignableFrom = function(source) {
- var check = function(target, type) {
- if (type.__genericTypeDefinition === target.__genericTypeDefinition && type.__typeArguments.length == target.__typeArguments.length) {
- for (var i = 0; i < target.__typeArguments.length; i++) {
- var v = target.__metadata.variance[i], t = target.__typeArguments[i], s = type.__typeArguments[i];
- switch (v) {
- case 1: if (!ss.isAssignableFrom(t, s)) return false; break;
- case 2: if (!ss.isAssignableFrom(s, t)) return false; break;
- default: if (s !== t) return false;
- }
- }
- return true;
- }
- return false;
- };
-
- if (source.__interface && check(this, source))
- return true;
- var ifs = ss.getInterfaces(source);
- for (var i = 0; i < ifs.length; i++) {
- if (ifs[i] === this || check(this, ifs[i]))
- return true;
- }
- return false;
- };
- }
-}
-
-ss.initClass = function ss$initClass(ctor, asm, members, baseType, interfaces) {
- ctor.__class = true;
- ctor.__assembly = asm;
- if (!ctor.__typeArguments)
- asm.__types[ctor.__typeName] = ctor;
- if (baseType && baseType !== Object) {
- var f = function(){};
- f.prototype = baseType.prototype;
- ctor.prototype = new f();
- ctor.prototype.constructor = ctor;
- }
- ss.shallowCopy(members, ctor.prototype);
- if (interfaces)
- ctor.__interfaces = interfaces;
-};
-
-ss.initGenericClass = function ss$initGenericClass(ctor, asm, typeArgumentCount) {
- ctor.__class = true;
- ctor.__assembly = asm;
- asm.__types[ctor.__typeName] = ctor;
- ctor.__typeArgumentCount = typeArgumentCount;
- ctor.__isGenericTypeDefinition = true;
-};
-
-ss.initInterface = function ss$initInterface(ctor, asm, members, baseInterfaces) {
- ctor.__interface = true;
- ctor.__assembly = asm;
- if (!ctor.__typeArguments)
- asm.__types[ctor.__typeName] = ctor;
- if (baseInterfaces)
- ctor.__interfaces = baseInterfaces;
- ss.shallowCopy(members, ctor.prototype);
- ctor.isAssignableFrom = function(type) { return ss.contains(ss.getInterfaces(type), this); };
-};
-
-ss.initGenericInterface = function ss$initGenericClass(ctor, asm, typeArgumentCount) {
- ctor.__interface = true;
- ctor.__assembly = asm;
- asm.__types[ctor.__typeName] = ctor;
- ctor.__typeArgumentCount = typeArgumentCount;
- ctor.__isGenericTypeDefinition = true;
-};
-
-ss.initEnum = function ss$initEnum(ctor, asm, members, namedValues) {
- ctor.__enum = true;
- ctor.__assembly = asm;
- asm.__types[ctor.__typeName] = ctor;
- ss.shallowCopy(members, ctor.prototype);
- ctor.getDefaultValue = ctor.createInstance = function() { return namedValues ? null : 0; };
- ctor.isInstanceOfType = function(instance) { return typeof(instance) == (namedValues ? 'string' : 'number'); };
-};
-
-ss.getBaseType = function ss$getBaseType(type) {
- if (type === Object || type.__interface) {
- return null;
- }
- else if (Object.getPrototypeOf) {
- return Object.getPrototypeOf(type.prototype).constructor;
- }
- else {
- var p = type.prototype;
- if (Object.prototype.hasOwnProperty.call(p, 'constructor')) {
- try {
- var ownValue = p.constructor;
- delete p.constructor;
- return p.constructor;
- }
- finally {
- p.constructor = ownValue;
- }
- }
- return p.constructor;
- }
-};
-
-ss.getTypeFullName = function ss$getTypeFullName(type) {
- return type.__typeName || type.name || (type.toString().match(/^\s*function\s*([^\s(]+)/) || [])[1] || 'Object';
-};
-
-ss.getTypeQName = function ss$getTypeFullName(type) {
- return ss.getTypeFullName(type) + (type.__assembly ? ', ' + type.__assembly.name : '');
-};
-
-ss.getTypeName = function ss$getTypeName(type) {
- var fullName = ss.getTypeFullName(type);
- var bIndex = fullName.indexOf('[');
- var nsIndex = fullName.lastIndexOf('.', bIndex >= 0 ? bIndex : fullName.length);
- return nsIndex > 0 ? fullName.substr(nsIndex + 1) : fullName;
-};
-
-ss.getTypeNamespace = function ss$getTypeNamespace(type) {
- var fullName = ss.getTypeFullName(type);
- var bIndex = fullName.indexOf('[');
- var nsIndex = fullName.lastIndexOf('.', bIndex >= 0 ? bIndex : fullName.length);
- return nsIndex > 0 ? fullName.substr(0, nsIndex) : '';
-};
-
-ss.getTypeAssembly = function ss$getTypeAssembly(type) {
- if (ss.contains([Date, Number, Boolean, String, Function, Array], type))
- return ss;
- else
- return type.__assembly || null;
-};
-
-ss.getAssemblyType = function ss$getAssemblyTypes(asm, name) {
- var result = [];
- if (asm.__types) {
- return asm.__types[name] || null;
- }
- else {
- var a = name.split('.');
- for (var i = 0; i < a.length; i++) {
- asm = asm[a[i]];
- if (!ss.isValue(asm))
- return null;
- }
- if (typeof asm !== 'function')
- return null;
- return asm;
- }
-};
-
-ss.getAssemblyTypes = function ss$getAssemblyTypes(asm) {
- var result = [];
- if (asm.__types) {
- for (var t in asm.__types) {
- if (asm.__types.hasOwnProperty(t))
- result.push(asm.__types[t]);
- }
- }
- else {
- var traverse = function(s, n) {
- for (var c in s) {
- if (s.hasOwnProperty(c))
- traverse(s[c], c);
- }
- if (typeof(s) === 'function' && ss.isUpper(n.charCodeAt(0)))
- result.push(s);
- };
- traverse(asm, '');
- }
- return result;
-};
-
-ss.createAssemblyInstance = function ss$createAssemblyInstance(asm, typeName) {
- var t = ss.getAssemblyType(asm, typeName);
- return t ? ss.createInstance(t) : null;
-};
-
-ss.getInterfaces = function ss$getInterfaces(type) {
- if (type.__interfaces)
- return type.__interfaces;
- else if (type === Date || type === Number)
- return [ ss_IEquatable, ss_IComparable, ss_IFormattable ];
- else if (type === Boolean || type === String)
- return [ ss_IEquatable, ss_IComparable ];
- else if (type === Array || ss.isTypedArrayType(type))
- return [ ss_IEnumerable, ss_ICollection, ss_IList ];
- else
- return [];
-};
-
-ss.isInstanceOfType = function ss$isInstanceOfType(instance, type) {
- if (ss.isNullOrUndefined(instance))
- return false;
-
- if (typeof(type.isInstanceOfType) === 'function')
- return type.isInstanceOfType(instance);
-
- return ss.isAssignableFrom(type, ss.getInstanceType(instance));
-};
-
-ss.isAssignableFrom = function ss$isAssignableFrom(target, type) {
- return target === type || (typeof(target.isAssignableFrom) === 'function' && target.isAssignableFrom(type)) || type.prototype instanceof target;
-};
-
-ss.isClass = function Type$isClass(type) {
- return (type.__class == true || type === Array || type === Function || type === RegExp || type === String || type === Error || type === Object);
-};
-
-ss.isEnum = function Type$isEnum(type) {
- return !!type.__enum;
-};
-
-ss.isFlags = function Type$isFlags(type) {
- return type.__metadata && type.__metadata.enumFlags || false;
-};
-
-ss.isInterface = function Type$isInterface(type) {
- return !!type.__interface;
-};
-
-ss.safeCast = function ss$safeCast(instance, type) {
- if (type === true)
- return instance;
- else if (type === false)
- return null;
- else
- return ss.isInstanceOfType(instance, type) ? instance : null;
-};
-
-ss.cast = function ss$cast(instance, type) {
- if (instance === null || typeof(instance) === 'undefined')
- return instance;
- else if (type === true || (type !== false && ss.isInstanceOfType(instance, type)))
- return instance;
- throw new ss_InvalidCastException('Cannot cast object to type ' + ss.getTypeFullName(type));
-};
-
-ss.getInstanceType = function ss$getInstanceType(instance) {
- if (!ss.isValue(instance))
- throw new ss_NullReferenceException('Cannot get type of null');
-
- // NOTE: We have to catch exceptions because the constructor
- // cannot be looked up on native COM objects
- try {
- return instance.constructor;
- }
- catch (ex) {
- return Object;
- }
-};
-
-ss.getType = function ss$getType(typeName) {
- if (!typeName)
- return null;
-
- var arr = typeName.split(',');
- var module = (arr.length > 1 ? ss.__assemblies[arr[1].trim()] : global);
- return module ? ss.getAssemblyType(module, arr[0].trim()) : null;
-};
-
-ss.getDefaultValue = function ss$getDefaultValue(type) {
- if (typeof(type.getDefaultValue) === 'function')
- return type.getDefaultValue();
- else if (type === Boolean)
- return false;
- else if (type === Date)
- return new Date(0);
- else if (type === Number)
- return 0;
- return null;
-};
-
-ss.createInstance = function ss$createInstance(type) {
- if (typeof(type.createInstance) === 'function')
- return type.createInstance();
- else if (type === Boolean)
- return false;
- else if (type === Date)
- return new Date(0);
- else if (type === Number)
- return 0;
- else if (type === String)
- return '';
- else
- return new type();
-};
-
-ss.applyConstructor = function ss$applyConstructor(constructor, args) {
- var f = function() {
- constructor.apply(this, args);
- };
- f.prototype = constructor.prototype;
- return new f();
-};
-
-ss.getAttributes = function ss$getAttributes(type, attrType, inherit) {
- var result = [];
- if (inherit) {
- var b = ss.getBaseType(type);
- if (b) {
- var a = ss.getAttributes(b, attrType, true);
- for (var i = 0; i < a.length; i++) {
- var t = ss.getInstanceType(a[i]);
- if (!t.__metadata || !t.__metadata.attrNoInherit)
- result.push(a[i]);
- }
- }
- }
- if (type.__metadata && type.__metadata.attr) {
- for (var i = 0; i < type.__metadata.attr.length; i++) {
- var a = type.__metadata.attr[i];
- if (attrType == null || ss.isInstanceOfType(a, attrType)) {
- var t = ss.getInstanceType(a);
- if (!t.__metadata || !t.__metadata.attrAllowMultiple) {
- for (var j = result.length - 1; j >= 0; j--) {
- if (ss.isInstanceOfType(result[j], t))
- result.splice(j, 1);
- }
- }
- result.push(a);
- }
- }
- }
- return result;
-};
-
-ss.getMembers = function ss$getMembers(type, memberTypes, bindingAttr, name, params) {
- var result = [];
- if ((bindingAttr & 72) == 72 || (bindingAttr & 6) == 4) {
- var b = ss.getBaseType(type);
- if (b)
- result = ss.getMembers(b, memberTypes & ~1, bindingAttr & (bindingAttr & 64 ? 255 : 247) & (bindingAttr & 2 ? 251 : 255), name, params);
- }
-
- var f = function(m) {
- if ((memberTypes & m.type) && (((bindingAttr & 4) && !m.isStatic) || ((bindingAttr & 8) && m.isStatic)) && (!name || m.name === name)) {
- if (params) {
- if ((m.params || []).length !== params.length)
- return;
- for (var i = 0; i < params.length; i++) {
- if (params[i] !== m.params[i])
- return;
- }
- }
- result.push(m);
- }
- };
-
- if (type.__metadata && type.__metadata.members) {
- for (var i = 0; i < type.__metadata.members.length; i++) {
- var m = type.__metadata.members[i];
- f(m);
- for (var j = 0; j < 4; j++) {
- var a = ['getter','setter','adder','remover'][j];
- if (m[a])
- f(m[a]);
- }
- }
- }
-
- if (bindingAttr & 256) {
- while (type) {
- var r = [];
- for (var i = 0; i < result.length; i++) {
- if (result[i].typeDef === type)
- r.push(result[i]);
- }
- if (r.length > 1)
- throw new ss_AmbiguousMatchException('Ambiguous match');
- else if (r.length === 1)
- return r[0];
- type = ss.getBaseType(type);
- }
- return null;
- }
-
- return result;
-};
-
-ss.midel = function ss$midel(mi, target, typeArguments) {
- if (mi.isStatic && !!target)
- throw new ss_ArgumentException('Cannot specify target for static method');
- else if (!mi.isStatic && !target)
- throw new ss_ArgumentException('Must specify target for instance method');
-
- var method;
- if (mi.fget) {
- method = function() { return (mi.isStatic ? mi.typeDef : this)[mi.fget]; };
- }
- else if (mi.fset) {
- method = function(v) { (mi.isStatic ? mi.typeDef : this)[mi.fset] = v; };
- }
- else {
- method = mi.def || (mi.isStatic || mi.sm ? mi.typeDef[mi.sname] : target[mi.sname]);
-
- if (mi.tpcount) {
- if (!typeArguments || typeArguments.length !== mi.tpcount)
- throw new ss_ArgumentException('Wrong number of type arguments');
- method = method.apply(null, typeArguments);
- }
- else {
- if (typeArguments && typeArguments.length)
- throw new ss_ArgumentException('Cannot specify type arguments for non-generic method');
- }
- if (mi.exp) {
- var _m1 = method;
- method = function () { return _m1.apply(this, Array.prototype.slice.call(arguments, 0, arguments.length - 1).concat(arguments[arguments.length - 1])); };
- }
- if (mi.sm) {
- var _m2 = method;
- method = function() { return _m2.apply(null, [this].concat(Array.prototype.slice.call(arguments))); };
- }
- }
- return ss.mkdel(target, method);
-};
-
-ss.invokeCI = function ss$invokeCI(ci, args) {
- if (ci.exp)
- args = args.slice(0, args.length - 1).concat(args[args.length - 1]);
-
- if (ci.def)
- return ci.def.apply(null, args);
- else if (ci.sm)
- return ci.typeDef[ci.sname].apply(null, args);
- else
- return ss.applyConstructor(ci.sname ? ci.typeDef[ci.sname] : ci.typeDef, args);
-};
-
-ss.fieldAccess = function ss$fieldAccess(fi, obj) {
- if (fi.isStatic && !!obj)
- throw new ss_ArgumentException('Cannot specify target for static field');
- else if (!fi.isStatic && !obj)
- throw new ss_ArgumentException('Must specify target for instance field');
- obj = fi.isStatic ? fi.typeDef : obj;
- if (arguments.length === 3)
- obj[fi.sname] = arguments[2];
- else
- return obj[fi.sname];
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IFormattable
-
-var ss_IFormattable = function IFormattable$() { };
-
-ss_IFormattable.__typeName = 'ss.IFormattable';
-ss.IFormattable = ss_IFormattable;
-ss.initInterface(ss_IFormattable, ss, { format: null });
-
-ss.format = function ss$format(obj, fmt) {
- if (typeof(obj) === 'number')
- return ss.formatNumber(obj, fmt);
- else if (ss.isDate(obj))
- return ss.formatDate(obj, fmt);
- else
- return obj.format(fmt);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IComparable
-
-var ss_IComparable = function IComparable$() { };
-
-ss_IComparable.__typeName = 'ss.IComparable';
-ss.IComparable = ss_IComparable;
-ss.initInterface(ss_IComparable, ss, { compareTo: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// IEquatable
-
-var ss_IEquatable = function IEquatable$() { };
-
-ss_IEquatable.__typeName = 'ss.IEquatable';
-ss.IEquatable = ss_IEquatable;
-ss.initInterface(ss_IEquatable, ss, { equalsT: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// Number Extensions
-
-ss.formatNumber = function ss$formatNumber(num, format) {
- if (ss.isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) {
- return num.toString();
- }
- return ss.netFormatNumber(num, format, ss_CultureInfo.invariantCulture.numberFormat);
-};
-
-ss.localeFormatNumber = function ss$localeFormatNumber(num, format) {
- if (ss.isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) {
- return num.toLocaleString();
- }
- return ss.netFormatNumber(num, format, ss_CultureInfo.currentCulture.numberFormat);
-};
-
-ss._commaFormatNumber = function ss$_commaFormat(number, groups, decimal, comma) {
- var decimalPart = null;
- var decimalIndex = number.indexOf(decimal);
- if (decimalIndex > 0) {
- decimalPart = number.substr(decimalIndex);
- number = number.substr(0, decimalIndex);
- }
-
- var negative = ss.startsWithString(number, '-');
- if (negative) {
- number = number.substr(1);
- }
-
- var groupIndex = 0;
- var groupSize = groups[groupIndex];
- if (number.length < groupSize) {
- return (negative ? '-' : '') + (decimalPart ? number + decimalPart : number);
- }
-
- var index = number.length;
- var s = '';
- var done = false;
- while (!done) {
- var length = groupSize;
- var startIndex = index - length;
- if (startIndex < 0) {
- groupSize += startIndex;
- length += startIndex;
- startIndex = 0;
- done = true;
- }
- if (!length) {
- break;
- }
-
- var part = number.substr(startIndex, length);
- if (s.length) {
- s = part + comma + s;
- }
- else {
- s = part;
- }
- index -= length;
-
- if (groupIndex < groups.length - 1) {
- groupIndex++;
- groupSize = groups[groupIndex];
- }
- }
-
- if (negative) {
- s = '-' + s;
- }
- return decimalPart ? s + decimalPart : s;
-};
-
-ss.netFormatNumber = function ss$netFormatNumber(num, format, numberFormat) {
- var nf = (numberFormat && numberFormat.getFormat(ss_NumberFormatInfo)) || ss_CultureInfo.currentCulture.numberFormat;
-
- var s = '';
- var precision = -1;
-
- if (format.length > 1) {
- precision = parseInt(format.substr(1));
- }
-
- var fs = format.charAt(0);
- switch (fs) {
- case 'd': case 'D':
- s = parseInt(Math.abs(num)).toString();
- if (precision != -1) {
- s = ss.padLeftString(s, precision, 0x30);
- }
- if (num < 0) {
- s = '-' + s;
- }
- break;
- case 'x': case 'X':
- s = parseInt(Math.abs(num)).toString(16);
- if (fs == 'X') {
- s = s.toUpperCase();
- }
- if (precision != -1) {
- s = ss.padLeftString(s, precision, 0x30);
- }
- break;
- case 'e': case 'E':
- if (precision == -1) {
- s = num.toExponential();
- }
- else {
- s = num.toExponential(precision);
- }
- if (fs == 'E') {
- s = s.toUpperCase();
- }
- break;
- case 'f': case 'F':
- case 'n': case 'N':
- if (precision == -1) {
- precision = nf.numberDecimalDigits;
- }
- s = num.toFixed(precision).toString();
- if (precision && (nf.numberDecimalSeparator != '.')) {
- var index = s.indexOf('.');
- s = s.substr(0, index) + nf.numberDecimalSeparator + s.substr(index + 1);
- }
- if ((fs == 'n') || (fs == 'N')) {
- s = ss._commaFormatNumber(s, nf.numberGroupSizes, nf.numberDecimalSeparator, nf.numberGroupSeparator);
- }
- break;
- case 'c': case 'C':
- if (precision == -1) {
- precision = nf.currencyDecimalDigits;
- }
- s = Math.abs(num).toFixed(precision).toString();
- if (precision && (nf.currencyDecimalSeparator != '.')) {
- var index = s.indexOf('.');
- s = s.substr(0, index) + nf.currencyDecimalSeparator + s.substr(index + 1);
- }
- s = ss._commaFormatNumber(s, nf.currencyGroupSizes, nf.currencyDecimalSeparator, nf.currencyGroupSeparator);
- if (num < 0) {
- s = ss.formatString(nf.currencyNegativePattern, s);
- }
- else {
- s = ss.formatString(nf.currencyPositivePattern, s);
- }
- break;
- case 'p': case 'P':
- if (precision == -1) {
- precision = nf.percentDecimalDigits;
- }
- s = (Math.abs(num) * 100.0).toFixed(precision).toString();
- if (precision && (nf.percentDecimalSeparator != '.')) {
- var index = s.indexOf('.');
- s = s.substr(0, index) + nf.percentDecimalSeparator + s.substr(index + 1);
- }
- s = ss._commaFormatNumber(s, nf.percentGroupSizes, nf.percentDecimalSeparator, nf.percentGroupSeparator);
- if (num < 0) {
- s = ss.formatString(nf.percentNegativePattern, s);
- }
- else {
- s = ss.formatString(nf.percentPositivePattern, s);
- }
- break;
- }
-
- return s;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// String Extensions
-ss.netSplit = function ss$netSplit(s, strings, limit, options) {
- var re = new RegExp(strings.map(ss.regexpEscape).join('|'), 'g'), res = [], m, i;
- for (i = 0;; i = re.lastIndex) {
- if (m = re.exec(s)) {
- if (options !== 1 || m.index > i) {
- if (res.length === limit - 1) {
- res.push(s.substr(i));
- return res;
- }
- else
- res.push(s.substring(i, m.index));
- }
- }
- else {
- if (options !== 1 || i !== s.length)
- res.push(s.substr(i));
- return res;
- }
- }
-};
-
-ss.compareStrings = function ss$compareStrings(s1, s2, ignoreCase) {
- if (ignoreCase) {
- if (s1) {
- s1 = s1.toUpperCase();
- }
- if (s2) {
- s2 = s2.toUpperCase();
- }
- }
- s1 = s1 || '';
- s2 = s2 || '';
-
- if (s1 == s2) {
- return 0;
- }
- if (s1 < s2) {
- return -1;
- }
- return 1;
-};
-
-ss.endsWithString = function ss$endsWithString(s, suffix) {
- if (!suffix.length) {
- return true;
- }
- if (suffix.length > s.length) {
- return false;
- }
- return (s.substr(s.length - suffix.length) == suffix);
-};
-
-ss._formatString = function ss$_formatString(format, values, useLocale) {
- if (!ss._formatRE) {
- ss._formatRE = /\{\{|\}\}|\{[^\}\{]+\}/g;
- }
-
- return format.replace(ss._formatRE,
- function(m) {
- if (m === '{{' || m === '}}')
- return m.charAt(0);
- var index = parseInt(m.substr(1));
- var value = values[index + 1];
- if (ss.isNullOrUndefined(value)) {
- return '';
- }
- if (ss.isInstanceOfType(value, ss_IFormattable)) {
- var formatSpec = null;
- var formatIndex = m.indexOf(':');
- if (formatIndex > 0) {
- formatSpec = m.substring(formatIndex + 1, m.length - 1);
- }
- return ss.format(value, formatSpec);
- }
- else {
- return useLocale ? value.toLocaleString() : value.toString();
- }
- });
-};
-
-ss.formatString = function String$format(format) {
- return ss._formatString(format, arguments, /* useLocale */ false);
-};
-
-ss.stringFromChar = function ss$stringFromChar(ch, count) {
- var s = ch;
- for (var i = 1; i < count; i++) {
- s += ch;
- }
- return s;
-};
-
-ss.htmlDecode = function ss$htmlDecode(s) {
- return s.replace(/&([^;]+);/g, function(_, e) {
- if (e[0] === '#')
- return String.fromCharCode(parseInt(e.substr(1)));
- switch (e) {
- case 'quot': return '"';
- case 'apos': return "'";
- case 'amp': return '&';
- case 'lt': return '<';
- case 'gt': return '>';
- default : return '&' + e + ';';
- }
- });
-};
-
-ss.htmlEncode = function ss$htmlEncode(s) {
- return s.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>');
-};
-
-ss.jsEncode = function ss$jsEncode(s, q) {
- s = s.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/"/g, '\\"');
- return q ? '"' + s + '"' : s;
-};
-
-ss.indexOfAnyString = function ss$indexOfAnyString(s, chars, startIndex, count) {
- var length = s.length;
- if (!length) {
- return -1;
- }
-
- chars = String.fromCharCode.apply(null, chars);
- startIndex = startIndex || 0;
- count = count || length;
-
- var endIndex = startIndex + count - 1;
- if (endIndex >= length) {
- endIndex = length - 1;
- }
-
- for (var i = startIndex; i <= endIndex; i++) {
- if (chars.indexOf(s.charAt(i)) >= 0) {
- return i;
- }
- }
- return -1;
-};
-
-ss.insertString = function ss$insertString(s, index, value) {
- if (!value) {
- return s;
- }
- if (!index) {
- return value + s;
- }
- var s1 = s.substr(0, index);
- var s2 = s.substr(index);
- return s1 + value + s2;
-};
-
-ss.isNullOrEmptyString = function ss$isNullOrEmptyString(s) {
- return !s || !s.length;
-};
-
-ss.lastIndexOfAnyString = function ss$lastIndexOfAnyString(s, chars, startIndex, count) {
- var length = s.length;
- if (!length) {
- return -1;
- }
-
- chars = String.fromCharCode.apply(null, chars);
- startIndex = startIndex || length - 1;
- count = count || length;
-
- var endIndex = startIndex - count + 1;
- if (endIndex < 0) {
- endIndex = 0;
- }
-
- for (var i = startIndex; i >= endIndex; i--) {
- if (chars.indexOf(s.charAt(i)) >= 0) {
- return i;
- }
- }
- return -1;
-};
-
-ss.localeFormatString = function ss$localeFormatString(format) {
- return ss._formatString(format, arguments, /* useLocale */ true);
-};
-
-ss.padLeftString = function ss$padLeftString(s, totalWidth, ch) {
- if (s.length < totalWidth) {
- ch = String.fromCharCode(ch || 0x20);
- return ss.stringFromChar(ch, totalWidth - s.length) + s;
- }
- return s;
-};
-
-ss.padRightString = function ss$padRightString(s, totalWidth, ch) {
- if (s.length < totalWidth) {
- ch = String.fromCharCode(ch || 0x20);
- return s + ss.stringFromChar(ch, totalWidth - s.length);
- }
- return s;
-};
-
-ss.removeString = function ss$removeString(s, index, count) {
- if (!count || ((index + count) > this.length)) {
- return s.substr(0, index);
- }
- return s.substr(0, index) + s.substr(index + count);
-};
-
-ss.replaceAllString = function ss$replaceAllString(s, oldValue, newValue) {
- newValue = newValue || '';
- return s.split(oldValue).join(newValue);
-};
-
-ss.startsWithString = function ss$startsWithString(s, prefix) {
- if (!prefix.length) {
- return true;
- }
- if (prefix.length > s.length) {
- return false;
- }
- return (s.substr(0, prefix.length) == prefix);
-};
-
-if (!String.prototype.trim) {
- String.prototype.trim = function String$trim() {
- return ss.trimStartString(ss.trimEndString(this));
- };
-}
-
-ss.trimEndString = function ss$trimEndString(s, chars) {
- return s.replace(chars ? new RegExp('[' + String.fromCharCode.apply(null, chars) + ']+$') : /\s*$/, '');
-};
-
-ss.trimStartString = function ss$trimStartString(s, chars) {
- return s.replace(chars ? new RegExp('^[' + String.fromCharCode.apply(null, chars) + ']+') : /^\s*/, '');
-};
-
-ss.trimString = function ss$trimString(s, chars) {
- return ss.trimStartString(ss.trimEndString(s, chars), chars);
-};
-
-ss.lastIndexOfString = function ss$lastIndexOfString(s, search, startIndex, count) {
- var index = s.lastIndexOf(search, startIndex);
- return (index < (startIndex - count + 1)) ? -1 : index;
-};
-
-ss.indexOfString = function ss$indexOfString(s, search, startIndex, count) {
- var index = s.indexOf(search, startIndex);
- return ((index + search.length) <= (startIndex + count)) ? index : -1;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Math Extensions
-
-ss.divRem = function ss$divRem(a, b, result) {
- var remainder = a % b;
- result.$ = remainder;
- return (a - remainder) / b;
-};
-
-ss.round = function ss$round(n, d, rounding) {
- var m = Math.pow(10, d || 0);
- n *= m;
- var sign = (n > 0) | -(n < 0);
- if (n % 1 === 0.5 * sign) {
- var f = Math.floor(n);
- return (f + (rounding ? (sign > 0) : (f % 2 * sign))) / m;
- }
-
- return Math.round(n) / m;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IFormatProvider
-
-var ss_IFormatProvider = function IFormatProvider$() { };
-
-ss_IFormatProvider.__typeName = 'ss.IFormatProvider';
-ss.IFormatProvider = ss_IFormatProvider;
-ss.initInterface(ss_IFormatProvider, ss, { getFormat: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// NumberFormatInfo
-
-var ss_NumberFormatInfo = function NumberFormatInfo$() {
-};
-
-ss_NumberFormatInfo.__typeName = 'ss.NumberFormatInfo';
-ss.NumberFormatInfo = ss_NumberFormatInfo;
-ss.initClass(ss_NumberFormatInfo, ss, {
- getFormat: function NumberFormatInfo$getFormat(type) {
- return (type === ss_NumberFormatInfo) ? this : null;
- }
-}, null, [ss_IFormatProvider]);
-
-ss_NumberFormatInfo.invariantInfo = new ss_NumberFormatInfo();
-ss.shallowCopy({
- naNSymbol: 'NaN',
- negativeSign: '-',
- positiveSign: '+',
- negativeInfinitySymbol: '-Infinity',
- positiveInfinitySymbol: 'Infinity',
-
- percentSymbol: '%',
- percentGroupSizes: [3],
- percentDecimalDigits: 2,
- percentDecimalSeparator: '.',
- percentGroupSeparator: ',',
- percentPositivePattern: 0,
- percentNegativePattern: 0,
-
- currencySymbol: '$',
- currencyGroupSizes: [3],
- currencyDecimalDigits: 2,
- currencyDecimalSeparator: '.',
- currencyGroupSeparator: ',',
- currencyNegativePattern: 0,
- currencyPositivePattern: 0,
-
- numberGroupSizes: [3],
- numberDecimalDigits: 2,
- numberDecimalSeparator: '.',
- numberGroupSeparator: ','
-}, ss_NumberFormatInfo.invariantInfo);
-
-///////////////////////////////////////////////////////////////////////////////
-// DateTimeFormatInfo
-
-var ss_DateTimeFormatInfo = function DateTimeFormatInfo$() {
-};
-
-ss_DateTimeFormatInfo.__typeName = 'ss.DateTimeFormatInfo';
-ss.DateTimeFormatInfo = ss_DateTimeFormatInfo;
-ss.initClass(ss_DateTimeFormatInfo, ss, {
- getFormat: function DateTimeFormatInfo$getFormat(type) {
- return type === ss_DateTimeFormatInfo ? this : null;
- }
-}, null, [ss_IFormatProvider]);
-
-ss_DateTimeFormatInfo.invariantInfo = new ss_DateTimeFormatInfo();
-ss.shallowCopy({
- amDesignator: 'AM',
- pmDesignator: 'PM',
-
- dateSeparator: '/',
- timeSeparator: ':',
-
- gmtDateTimePattern: 'ddd, dd MMM yyyy HH:mm:ss \'GMT\'',
- universalDateTimePattern: 'yyyy-MM-dd HH:mm:ssZ',
- sortableDateTimePattern: 'yyyy-MM-ddTHH:mm:ss',
- dateTimePattern: 'dddd, MMMM dd, yyyy h:mm:ss tt',
-
- longDatePattern: 'dddd, MMMM dd, yyyy',
- shortDatePattern: 'M/d/yyyy',
-
- longTimePattern: 'h:mm:ss tt',
- shortTimePattern: 'h:mm tt',
-
- firstDayOfWeek: 0,
- dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
- shortDayNames: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
- minimizedDayNames: ['Su','Mo','Tu','We','Th','Fr','Sa'],
-
- monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December',''],
- shortMonthNames: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','']
-}, ss_DateTimeFormatInfo.invariantInfo);
-
-///////////////////////////////////////////////////////////////////////////////
-// Stopwatch
-
-var ss_Stopwatch = function Stopwatch$() {
- this._stopTime = 0;
- this._startTime = 0;
- this.isRunning = false;
-};
-
-ss_Stopwatch.startNew = function Stopwatch$startNew() {
- var s = new ss_Stopwatch();
- s.start();
- return s;
-};
-
-if (typeof(window) !== 'undefined' && window.performance && window.performance.now) {
- ss_Stopwatch.frequency = 1e6;
- ss_Stopwatch.isHighResolution = true;
- ss_Stopwatch.getTimestamp = function() { return Math.round(window.performance.now() * 1000); };
-}
-else if (typeof(process) !== 'undefined' && process.hrtime) {
- ss_Stopwatch.frequency = 1e9;
- ss_Stopwatch.isHighResolution = true;
- ss_Stopwatch.getTimestamp = function() { var hr = process.hrtime(); return hr[0] * 1e9 + hr[1]; };
-}
-else {
- ss_Stopwatch.frequency = 1e3;
- ss_Stopwatch.isHighResolution = false;
- ss_Stopwatch.getTimestamp = function() { return new Date().valueOf(); };
-}
-
-ss_Stopwatch.__typeName = 'ss.Stopwatch';
-ss.Stopwatch = ss_Stopwatch;
-ss.initClass(ss_Stopwatch, ss, {
- reset: function Stopwatch$reset() {
- this._stopTime = this._startTime = ss_Stopwatch.getTimestamp();
- this.isRunning = false;
- },
-
- ticks: function Stopwatch$ticks() {
- return (this.isRunning ? ss_Stopwatch.getTimestamp() : this._stopTime) - this._startTime;
- },
-
- milliseconds: function Stopwatch$milliseconds() {
- return Math.round(this.ticks() / ss_Stopwatch.frequency * 1000);
- },
-
- timeSpan: function Stopwatch$timeSpan() {
- return new ss_TimeSpan(this.milliseconds() * 10000);
- },
-
- start: function Stopwatch$start() {
- if (this.isRunning)
- return;
- this._startTime = ss_Stopwatch.getTimestamp();
- this.isRunning = true;
- },
-
- stop: function Stopwatch$stop() {
- if (!this.isRunning)
- return;
- this._stopTime = ss_Stopwatch.getTimestamp();
- this.isRunning = false;
- },
-
- restart: function Stopwatch$restart() {
- this.isRunning = false;
- this.start();
- }
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// Array Extensions
-
-ss._flatIndex = function ss$_flatIndex(arr, indices) {
- if (indices.length != (arr._sizes ? arr._sizes.length : 1))
- throw new ss_ArgumentException('Invalid number of indices');
-
- if (indices[0] < 0 || indices[0] >= (arr._sizes ? arr._sizes[0] : arr.length))
- throw new ss_ArgumentException('Index 0 out of range');
-
- var idx = indices[0];
- if (arr._sizes) {
- for (var i = 1; i < arr._sizes.length; i++) {
- if (indices[i] < 0 || indices[i] >= arr._sizes[i])
- throw new ss_ArgumentException('Index ' + i + ' out of range');
- idx = idx * arr._sizes[i] + indices[i];
- }
- }
- return idx;
-};
-
-ss.arrayGet2 = function ss$arrayGet2(arr, indices) {
- var idx = ss._flatIndex(arr, indices);
- var r = arr[idx];
- return typeof r !== 'undefined' ? r : arr._defvalue;
-};
-
-ss.arrayGet = function ss$arrayGet(arr) {
- return ss.arrayGet2(arr, Array.prototype.slice.call(arguments, 1));
-}
-
-ss.arraySet2 = function ss$arraySet2(arr, value, indices) {
- var idx = ss._flatIndex(arr, indices);
- arr[idx] = value;
-};
-
-ss.arraySet = function ss$arraySet() {
- return ss.arraySet2(arguments[0], arguments[arguments.length - 1], Array.prototype.slice.call(arguments, 1, arguments.length - 1));
-};
-
-ss.arrayRank = function ss$arrayRank(arr) {
- return arr._sizes ? arr._sizes.length : 1;
-};
-
-ss.arrayLength = function ss$arrayLength(arr, dimension) {
- if (dimension >= (arr._sizes ? arr._sizes.length : 1))
- throw new ss_ArgumentException('Invalid dimension');
- return arr._sizes ? arr._sizes[dimension] : arr.length;
-};
-
-ss.arrayExtract = function ss$arrayExtract(arr, start, count) {
- if (!ss.isValue(count)) {
- return arr.slice(start);
- }
- return arr.slice(start, start + count);
-};
-
-ss.arrayAddRange = function ss$arrayAddRange(arr, items) {
- if (items instanceof Array) {
- arr.push.apply(arr, items);
- }
- else {
- var e = ss.getEnumerator(items);
- try {
- while (e.moveNext()) {
- ss.add(arr, e.current());
- }
- }
- finally {
- if (ss.isInstanceOfType(e, ss_IDisposable)) {
- ss.cast(e, ss_IDisposable).dispose();
- }
- }
- }
-};
-
-ss.arrayClone = function ss$arrayClone(arr) {
- if (arr.length === 1) {
- return [arr[0]];
- }
- else {
- return Array.apply(null, arr);
- }
-};
-
-ss.arrayPeekFront = function ss$arrayPeekFront(arr) {
- if (arr.length)
- return arr[0];
- throw new ss_InvalidOperationException('Array is empty');
-};
-
-ss.arrayPeekBack = function ss$arrayPeekBack(arr) {
- if (arr.length)
- return arr[arr.length - 1];
- throw new ss_InvalidOperationException('Array is empty');
-};
-
-ss.indexOfArray = function ss$indexOfArray(arr, item, startIndex) {
- startIndex = startIndex || 0;
- for (var i = startIndex; i < arr.length; i++) {
- if (ss.staticEquals(arr[i], item)) {
- return i;
- }
- }
- return -1;
-}
-
-ss.arrayInsertRange = function ss$arrayInsertRange(arr, index, items) {
- if (items instanceof Array) {
- if (index === 0) {
- arr.unshift.apply(arr, items);
- }
- else {
- for (var i = 0; i < items.length; i++) {
- arr.splice(index + i, 0, items[i]);
- }
- }
- }
- else {
- var e = ss.getEnumerator(items);
- try {
- while (e.moveNext()) {
- arr.insert(index, e.current());
- index++;
- }
- }
- finally {
- if (ss.isInstanceOfType(e, ss_IDisposable)) {
- ss.cast(e, ss_IDisposable).dispose();
- }
- }
- }
-};
-
-if (!Array.prototype.map) {
- Array.prototype.map = function Array$map(callback, instance) {
- var length = this.length;
- var mapped = new Array(length);
- for (var i = 0; i < length; i++) {
- if (i in this) {
- mapped[i] = callback.call(instance, this[i], i, this);
- }
- }
- return mapped;
- };
-}
-
-ss.arrayRemoveRange = function ss$arrayRemoveRange(arr, index, count) {
- arr.splice(index, count);
-};
-
-if (!Array.prototype.some) {
- Array.prototype.some = function Array$some(callback, instance) {
- var length = this.length;
- for (var i = 0; i < length; i++) {
- if (i in this && callback.call(instance, this[i], i, this)) {
- return true;
- }
- }
- return false;
- };
-}
-
-ss.arrayFromEnumerable = function ss$arrayFromEnumerable(enm) {
- if (!ss.isValue(enm))
- return null;
-
- var e = ss.getEnumerator(enm), r = [];
- try {
- while (e.moveNext())
- r.push(e.current());
- }
- finally {
- e.dispose();
- }
- return r;
-};
-
-ss.multidimArray = function ss$multidimArray(defvalue, sizes) {
- var arr = [];
- arr._defvalue = defvalue;
- arr._sizes = [arguments[1]];
- var length = arguments[1];
- for (var i = 2; i < arguments.length; i++) {
- length *= arguments[i];
- arr._sizes[i - 1] = arguments[i];
- }
- arr.length = length;
- return arr;
-};
-
-ss.repeat = function ss$repeat(value, count) {
- var result = [];
- for (var i = 0; i < count; i++)
- result.push(value);
- return result;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Date Extensions
-
-ss.utcNow = function ss$utcNow() {
- var d = new Date();
- return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
-};
-
-ss.toUTC = function ss$toUniversalTime(d) {
- return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
-};
-
-ss.fromUTC = function ss$toLocalTime(d) {
- return new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()));
-};
-
-ss.today = function ss$today() {
- var d = new Date();
- return new Date(d.getFullYear(), d.getMonth(), d.getDate());
-}
-
-ss.formatDate = function ss$formatDate(date, format) {
- if (ss.isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) {
- return date.toString();
- }
- if (format == 'id') {
- return date.toDateString();
- }
- if (format == 'it') {
- return date.toTimeString();
- }
-
- return ss._netFormatDate(date, format, false);
-};
-
-ss.localeFormatDate = function ss$localeFormatDate(date, format) {
- if (ss.isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) {
- return date.toLocaleString();
- }
- if (format == 'id') {
- return date.toLocaleDateString();
- }
- if (format == 'it') {
- return date.toLocaleTimeString();
- }
-
- return ss._netFormatDate(date, format, true);
-};
-
-ss._netFormatDate = function ss$_netFormatDate(dt, format, useLocale) {
- var dtf = useLocale ? ss_CultureInfo.currentCulture.dateTimeFormat : ss_CultureInfo.invariantCulture.dateTimeFormat;
-
- if (format.length == 1) {
- switch (format) {
- case 'f': format = dtf.longDatePattern + ' ' + dtf.shortTimePattern; break;
- case 'F': format = dtf.dateTimePattern; break;
-
- case 'd': format = dtf.shortDatePattern; break;
- case 'D': format = dtf.longDatePattern; break;
-
- case 't': format = dtf.shortTimePattern; break;
- case 'T': format = dtf.longTimePattern; break;
-
- case 'g': format = dtf.shortDatePattern + ' ' + dtf.shortTimePattern; break;
- case 'G': format = dtf.shortDatePattern + ' ' + dtf.longTimePattern; break;
-
- case 'R': case 'r':
- dtf = ss_CultureInfo.InvariantCulture.dateTimeFormat;
- format = dtf.gmtDateTimePattern;
- break;
- case 'u': format = dtf.universalDateTimePattern; break;
- case 'U':
- format = dtf.dateTimePattern;
- dt = new Date(dt.getUTCFullYear(), dt.getUTCMonth(), dt.getUTCDate(),
- dt.getUTCHours(), dt.getUTCMinutes(), dt.getUTCSeconds(), dt.getUTCMilliseconds());
- break;
-
- case 's': format = dtf.sortableDateTimePattern; break;
- }
- }
-
- if (format.charAt(0) == '%') {
- format = format.substr(1);
- }
-
- if (!Date._formatRE) {
- Date._formatRE = /'.*?[^\\]'|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g;
- }
-
- var re = Date._formatRE;
- var sb = new ss_StringBuilder();
-
- re.lastIndex = 0;
- while (true) {
- var index = re.lastIndex;
- var match = re.exec(format);
-
- sb.append(format.slice(index, match ? match.index : format.length));
- if (!match) {
- break;
- }
-
- var fs = match[0];
- var part = fs;
- switch (fs) {
- case 'dddd':
- part = dtf.dayNames[dt.getDay()];
- break;
- case 'ddd':
- part = dtf.shortDayNames[dt.getDay()];
- break;
- case 'dd':
- part = ss.padLeftString(dt.getDate().toString(), 2, 0x30);
- break;
- case 'd':
- part = dt.getDate();
- break;
- case 'MMMM':
- part = dtf.monthNames[dt.getMonth()];
- break;
- case 'MMM':
- part = dtf.shortMonthNames[dt.getMonth()];
- break;
- case 'MM':
- part = ss.padLeftString((dt.getMonth() + 1).toString(), 2, 0x30);
- break;
- case 'M':
- part = (dt.getMonth() + 1);
- break;
- case 'yyyy':
- part = dt.getFullYear();
- break;
- case 'yy':
- part = ss.padLeftString((dt.getFullYear() % 100).toString(), 2, 0x30);
- break;
- case 'y':
- part = (dt.getFullYear() % 100);
- break;
- case 'h': case 'hh':
- part = dt.getHours() % 12;
- if (!part) {
- part = '12';
- }
- else if (fs == 'hh') {
- part = ss.padLeftString(part.toString(), 2, 0x30);
- }
- break;
- case 'HH':
- part = ss.padLeftString(dt.getHours().toString(), 2, 0x30);
- break;
- case 'H':
- part = dt.getHours();
- break;
- case 'mm':
- part = ss.padLeftString(dt.getMinutes().toString(), 2, 0x30);
- break;
- case 'm':
- part = dt.getMinutes();
- break;
- case 'ss':
- part = ss.padLeftString(dt.getSeconds().toString(), 2, 0x30);
- break;
- case 's':
- part = dt.getSeconds();
- break;
- case 't': case 'tt':
- part = (dt.getHours() < 12) ? dtf.amDesignator : dtf.pmDesignator;
- if (fs == 't') {
- part = part.charAt(0);
- }
- break;
- case 'fff':
- part = ss.padLeftString(dt.getMilliseconds().toString(), 3, 0x30);
- break;
- case 'ff':
- part = ss.padLeftString(dt.getMilliseconds().toString(), 3).substr(0, 2);
- break;
- case 'f':
- part = ss.padLeftString(dt.getMilliseconds().toString(), 3).charAt(0);
- break;
- case 'z':
- part = dt.getTimezoneOffset() / 60;
- part = ((part >= 0) ? '-' : '+') + Math.floor(Math.abs(part));
- break;
- case 'zz': case 'zzz':
- part = dt.getTimezoneOffset() / 60;
- part = ((part >= 0) ? '-' : '+') + Math.floor(ss.padLeftString(Math.abs(part)).toString(), 2, 0x30);
- if (fs == 'zzz') {
- part += dtf.timeSeparator + Math.abs(ss.padLeftString(dt.getTimezoneOffset() % 60).toString(), 2, 0x30);
- }
- break;
- default:
- if (part.charAt(0) == '\'') {
- part = part.substr(1, part.length - 2).replace(/\\'/g, '\'');
- }
- break;
- }
- sb.append(part);
- }
-
- return sb.toString();
-};
-
-ss._parseExactDate = function ss$_parseExactDate(val, format, provider, utc) {
- provider = (provider && provider.getFormat(ss_DateTimeFormatInfo)) || ss_CultureInfo.currentCulture.dateTimeFormat;
- var AM = provider.amDesignator, PM = provider.pmDesignator;
-
- var _isInteger = function(val) {
- var digits="1234567890";
- for (var i=0; i < val.length; i++) {
- if (digits.indexOf(val.charAt(i))==-1) {
- return false;
- }
- }
- return true;
- };
-
- var _getInt = function(str,i,minlength,maxlength) {
- for (var x=maxlength; x>=minlength; x--) {
- var token=str.substring(i,i+x);
- if (token.length < minlength) {
- return null;
- }
- if (_isInteger(token)) {
- return token;
- }
- }
- return null;
- };
-
- val = val + "";
- format = format + "";
- var i_val = 0;
- var i_format = 0;
- var c = "";
- var token = "";
-
- var year = 0, month = 1, date = 1, hh = 0, mm = 0, _ss = 0, ampm = "";
-
- while (i_format < format.length) {
- // Get next token from format string
- c = format.charAt(i_format);
- token = "";
- while ((format.charAt(i_format) == c) && (i_format < format.length)) {
- token += format.charAt(i_format++);
- }
- // Extract contents of value based on format token
- if (token=="yyyy" || token=="yy" || token=="y") {
- if (token == "yyyy")
- year = _getInt(val, i_val, 4, 4);
- if (token == "yy")
- year = _getInt(val, i_val, 2, 2);
- if (token == "y")
- year = _getInt(val, i_val, 2, 4);
-
- if (year == null)
- return null;
-
- i_val += year.length;
- if (year.length == 2) {
- if (year > 30) {
- year = 1900 + (year-0);
- }
- else {
- year = 2000 + (year-0);
- }
- }
- }
- else if (token == "MM" || token == "M") {
- month = _getInt(val, i_val, token.length, 2);
- if (month == null || (month < 1) || (month > 12))
- return null;
- i_val += month.length;
- }
- else if (token=="dd"||token=="d") {
- date = _getInt(val, i_val, token.length, 2);
- if (date == null || (date < 1) || (date > 31))
- return null;
- i_val += date.length;
- }
- else if (token=="hh"||token=="h") {
- hh = _getInt(val, i_val, token.length, 2);
- if (hh == null || (hh < 1) || (hh > 12))
- return null;
- i_val += hh.length;
- }
- else if (token=="HH"||token=="H") {
- hh = _getInt(val, i_val, token.length, 2);
- if (hh == null || (hh < 0) || (hh > 23))
- return null;
- i_val += hh.length;
- }
- else if (token == "mm" || token == "m") {
- mm = _getInt(val, i_val, token.length, 2);
- if (mm == null || (mm < 0) || (mm > 59))
- return null;
- i_val += mm.length;
- }
- else if (token == "ss" || token == "s") {
- _ss = _getInt(val, i_val, token.length, 2);
- if (_ss == null || (_ss < 0) || (_ss > 59))
- return null;
- i_val += _ss.length;
- }
- else if (token == "t") {
- if (val.substring(i_val, i_val + 1).toLowerCase() == AM.charAt(0).toLowerCase())
- ampm = AM;
- else if (val.substring(i_val, i_val + 1).toLowerCase() == PM.charAt(0).toLowerCase())
- ampm = PM;
- else
- return null;
- i_val += 1;
- }
- else if (token == "tt") {
- if (val.substring(i_val, i_val + 2).toLowerCase() == AM.toLowerCase())
- ampm = AM;
- else if (val.substring(i_val,i_val+2).toLowerCase() == PM.toLowerCase())
- ampm = PM;
- else
- return null;
- i_val += 2;
- }
- else {
- if (val.substring(i_val, i_val + token.length) != token)
- return null;
- else
- i_val += token.length;
- }
- }
- // If there are any trailing characters left in the value, it doesn't match
- if (i_val != val.length)
- return null;
-
- // Is date valid for month?
- if (month == 2) {
- // Check for leap year
- if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { // leap year
- if (date > 29)
- return null;
- }
- else if (date > 28)
- return null;
- }
- if ((month == 4) || (month == 6) || (month == 9) || (month == 11)) {
- if (date > 30) {
- return null;
- }
- }
- // Correct hours value
- if (hh < 12 && ampm == PM) {
- hh = hh - 0 + 12;
- }
- else if (hh > 11 && ampm == AM) {
- hh -= 12;
- }
-
- if (utc)
- return new Date(Date.UTC(year, month - 1, date, hh, mm, _ss));
- else
- return new Date(year, month - 1, date, hh, mm, _ss);
-};
-
-ss.parseExactDate = function ss$parseExactDate(val, format, provider) {
- return ss._parseExactDate(val, format, provider, false);
-};
-
-ss.parseExactDateUTC = function ss$parseExactDateUTC(val, format, provider) {
- return ss._parseExactDate(val, format, provider, true);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Function Extensions
-
-ss._delegateContains = function ss$_delegateContains(targets, object, method) {
- for (var i = 0; i < targets.length; i += 2) {
- if (targets[i] === object && targets[i + 1] === method) {
- return true;
- }
- }
- return false;
-};
-
-ss._mkdel = function ss$_mkdel(targets) {
- var delegate = function() {
- if (targets.length == 2) {
- return targets[1].apply(targets[0], arguments);
- }
- else {
- var clone = ss.arrayClone(targets);
- for (var i = 0; i < clone.length; i += 2) {
- if (ss._delegateContains(targets, clone[i], clone[i + 1])) {
- clone[i + 1].apply(clone[i], arguments);
- }
- }
- return null;
- }
- };
- delegate._targets = targets;
-
- return delegate;
-};
-
-ss.mkdel = function ss$mkdel(object, method) {
- if (!object) {
- return method;
- }
- return ss._mkdel([object, method]);
-};
-
-ss.delegateCombine = function ss$delegateCombine(delegate1, delegate2) {
- if (!delegate1) {
- if (!delegate2._targets) {
- return ss.mkdel(null, delegate2);
- }
- return delegate2;
- }
- if (!delegate2) {
- if (!delegate1._targets) {
- return ss.mkdel(null, delegate1);
- }
- return delegate1;
- }
-
- var targets1 = delegate1._targets ? delegate1._targets : [null, delegate1];
- var targets2 = delegate2._targets ? delegate2._targets : [null, delegate2];
-
- return ss._mkdel(targets1.concat(targets2));
-};
-
-ss.delegateRemove = function ss$delegateRemove(delegate1, delegate2) {
- if (!delegate1 || (delegate1 === delegate2)) {
- return null;
- }
- if (!delegate2) {
- return delegate1;
- }
-
- var targets = delegate1._targets;
- var object = null;
- var method;
- if (delegate2._targets) {
- object = delegate2._targets[0];
- method = delegate2._targets[1];
- }
- else {
- method = delegate2;
- }
-
- for (var i = 0; i < targets.length; i += 2) {
- if ((targets[i] === object) && (targets[i + 1] === method)) {
- if (targets.length == 2) {
- return null;
- }
- var t = ss.arrayClone(targets);
- t.splice(i, 2);
- return ss._mkdel(t);
- }
- }
-
- return delegate1;
-};
-
-ss.delegateEquals = function ss$delegateEquals(a, b) {
- if (a === b)
- return true;
- if (!a._targets && !b._targets)
- return false;
- var ta = a._targets || [null, a], tb = b._targets || [null, b];
- if (ta.length != tb.length)
- return false;
- for (var i = 0; i < ta.length; i++) {
- if (ta[i] !== tb[i])
- return false;
- }
- return true;
-};
-
-ss.delegateClone = function ss$delegateClone(source) {
- return source._targets ? ss._mkdel(source._targets) : function() { return source.apply(this, arguments); };
-};
-
-ss.thisFix = function ss$thisFix(source) {
- return function() {
- var x = [this];
- for(var i = 0; i < arguments.length; i++)
- x.push(arguments[i]);
- return source.apply(source, x);
- };
-};
-
-ss.getInvocationList = function ss$getInvocationList(delegate) {
- if (!delegate._targets)
- return [delegate];
- var result = [];
- for (var i = 0; i < delegate._targets.length; i += 2)
- result.push(ss.mkdel(delegate._targets[i], delegate._targets[i + 1]));
- return result;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RegExp Extensions
-ss.regexpEscape = function ss$regexpEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Debug Extensions
-
-ss.Debug = global.Debug || function() {};
-ss.Debug.__typeName = 'Debug';
-
-if (!ss.Debug.writeln) {
- ss.Debug.writeln = function Debug$writeln(text) {
- if (global.console) {
- if (global.console.debug) {
- global.console.debug(text);
- return;
- }
- else if (global.console.log) {
- global.console.log(text);
- return;
- }
- }
- else if (global.opera &&
- global.opera.postError) {
- global.opera.postError(text);
- return;
- }
- }
-};
-
-ss.Debug._fail = function Debug$_fail(message) {
- ss.Debug.writeln(message);
- debugger;
-};
-
-ss.Debug.assert = function Debug$assert(condition, message) {
- if (!condition) {
- message = 'Assert failed: ' + message;
- if (confirm(message + '\r\n\r\nBreak into debugger?')) {
- ss.Debug._fail(message);
- }
- }
-};
-
-ss.Debug.fail = function Debug$fail(message) {
- ss.Debug._fail(message);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Enum
-
-var ss_Enum = function Enum$() {
-};
-ss_Enum.__typeName = 'ss.Enum';
-ss.Enum = ss_Enum;
-ss.initClass(ss_Enum, ss, {});
-
-ss_Enum.parse = function Enum$parse(enumType, s) {
- var values = enumType.prototype;
- if (!ss.isFlags(enumType)) {
- for (var f in values) {
- if (f === s) {
- return values[f];
- }
- }
- }
- else {
- var parts = s.split('|');
- var value = 0;
- var parsed = true;
-
- for (var i = parts.length - 1; i >= 0; i--) {
- var part = parts[i].trim();
- var found = false;
-
- for (var f in values) {
- if (f === part) {
- value |= values[f];
- found = true;
- break;
- }
- }
- if (!found) {
- parsed = false;
- break;
- }
- }
-
- if (parsed) {
- return value;
- }
- }
- throw new ss_ArgumentException('Invalid Enumeration Value');
-};
-
-ss_Enum.toString = function Enum$toString(enumType, value) {
- var values = enumType.prototype;
- if (!ss.isFlags(enumType) || (value === 0)) {
- for (var i in values) {
- if (values[i] === value) {
- return i;
- }
- }
- throw new ss_ArgumentException('Invalid Enumeration Value');
- }
- else {
- var parts = [];
- for (var i in values) {
- if (values[i] & value) {
- ss.add(parts, i);
- }
- }
- if (!parts.length) {
- throw new ss_ArgumentException('Invalid Enumeration Value');
- }
- return parts.join(' | ');
- }
-};
-
-ss_Enum.getValues = function Enum$getValues(enumType) {
- var parts = [];
- var values = enumType.prototype;
- for (var i in values) {
- if (values.hasOwnProperty(i))
- parts.push(values[i]);
- }
- return parts;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// CultureInfo
-
-var ss_CultureInfo = function CultureInfo$(name, numberFormat, dateTimeFormat) {
- this.name = name;
- this.numberFormat = numberFormat;
- this.dateTimeFormat = dateTimeFormat;
-};
-
-ss_CultureInfo.__typeName = 'ss.CultureInfo';
-ss.CultureInfo = ss_CultureInfo;
-ss.initClass(ss_CultureInfo, ss, {
- getFormat: function CultureInfo$getFormat(type) {
- switch (type) {
- case ss_NumberFormatInfo: return this.numberFormat;
- case ss_DateTimeFormatInfo: return this.dateTimeFormat;
- default: return null;
- }
- }
-}, null, [ss_IFormatProvider]);
-
-ss_CultureInfo.invariantCulture = new ss_CultureInfo('en-US', ss_NumberFormatInfo.invariantInfo, ss_DateTimeFormatInfo.invariantInfo);
-ss_CultureInfo.currentCulture = ss_CultureInfo.invariantCulture;
-
-///////////////////////////////////////////////////////////////////////////////
-// IEnumerator
-
-var ss_IEnumerator = function IEnumerator$() { };
-
-ss_IEnumerator.__typeName = 'ss.IEnumerator';
-ss.IEnumerator = ss_IEnumerator;
-ss.initInterface(ss_IEnumerator, ss, { current: null, moveNext: null, reset: null }, [ss_IDisposable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// IEnumerable
-
-var ss_IEnumerable = function IEnumerable$() { };
-
-ss_IEnumerable.__typeName = 'ss.IEnumerable';
-ss.IEnumerable = ss_IEnumerable;
-ss.initInterface(ss_IEnumerable, ss, { getEnumerator: null });
-ss.getEnumerator = function ss$getEnumerator(obj) {
- return obj.getEnumerator ? obj.getEnumerator() : new ss_ArrayEnumerator(obj);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// ICollection
-
-var ss_ICollection = function ICollection$() { };
-
-ss_ICollection.__typeName = 'ss.ICollection';
-ss.ICollection = ss_ICollection;
-ss.initInterface(ss_ICollection, ss, { get_count: null, add: null, clear: null, contains: null, remove: null });
-
-ss.count = function ss$count(obj) {
- return obj.get_count ? obj.get_count() : obj.length;
-};
-
-ss.add = function ss$add(obj, item) {
- if (obj.add)
- obj.add(item);
- else if (ss.isArray(obj))
- obj.push(item);
- else
- throw new ss_NotSupportedException();
-};
-
-ss.clear = function ss$clear(obj) {
- if (obj.clear)
- obj.clear();
- else if (ss.isArray(obj))
- obj.length = 0;
- else
- throw new ss_NotSupportedException();
-};
-
-ss.remove = function ss$remove(obj, item) {
- if (obj.remove)
- return obj.remove(item);
- else if (ss.isArray(obj)) {
- var index = ss.indexOf(obj, item);
- if (index >= 0) {
- obj.splice(index, 1);
- return true;
- }
- return false;
- }
- else
- throw new ss_NotSupportedException();
-};
-
-ss.contains = function ss$contains(obj, item) {
- if (obj.contains)
- return obj.contains(item);
- else
- return ss.indexOf(obj, item) >= 0;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// TimeSpan
-
-var ss_TimeSpan = function TimeSpan$(ticks) {
- this.ticks = ticks || 0;
-};
-
-ss_TimeSpan.getDefaultValue = ss_TimeSpan.createInstance = function TimeSpan$default() {
- return new ss_TimeSpan(0);
-};
-
-ss_TimeSpan.__typeName = 'ss.TimeSpan';
-ss.TimeSpan = ss_TimeSpan;
-ss.initClass(ss_TimeSpan, ss, {
- compareTo: function TimeSpan$compareTo(other) {
- return this.ticks < other.ticks ? -1 : (this.ticks > other.ticks ? 1 : 0);
- },
- equals: function TimeSpan$equals(other) {
- return ss.isInstanceOfType(other, ss_TimeSpan) && other.ticks === this.ticks;
- },
- equalsT: function TimeSpan$equalsT(other) {
- return other.ticks === this.ticks;
- },
- toString: function TimeSpan$toString() {
- var d = function(s, n) { return ss.padLeftString(s + '', n || 2, 48); };
-
- var ticks = this.ticks;
- var result = '';
- if (Math.abs(ticks) >= 864000000000) {
- result += d((ticks / 864000000000) | 0) + '.';
- ticks %= 864000000000;
- }
- result += d(ticks / 36000000000 | 0) + ':';
- ticks %= 36000000000;
- result += d(ticks / 600000000 | 0) + ':';
- ticks %= 600000000;
- result += d(ticks / 10000000 | 0);
- ticks %= 10000000;
- if (ticks > 0)
- result += '.' + d(ticks, 7);
- return result;
- }
-}, null, [ss_IComparable, ss_IEquatable]);
-ss_TimeSpan.__class = false;
-
-///////////////////////////////////////////////////////////////////////////////
-// IEqualityComparer
-
-var ss_IEqualityComparer = function IEqualityComparer$() { };
-
-ss_IEqualityComparer.__typeName = 'ss.IEqualityComparer';
-ss.IEqualityComparer = ss_IEqualityComparer;
-ss.initInterface(ss_IEqualityComparer, ss, { areEqual: null, getObjectHashCode: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// IComparer
-
-var ss_IComparer = function IComparer$() { };
-
-ss_IComparer.__typeName = 'ss.IComparer';
-ss.IComparer = ss_IComparer;
-ss.initInterface(ss_IComparer, ss, { compare: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// Nullable
-
-ss.unbox = function ss$unbox(instance) {
- if (!ss.isValue(instance))
- throw new ss_InvalidOperationException('Nullable object must have a value.');
- return instance;
-};
-
-var ss_Nullable$1 = function Nullable$1$(T) {
- var $type = function() {
- };
- $type.isInstanceOfType = function(instance) {
- return ss.isInstanceOfType(instance, T);
- };
- ss.registerGenericClassInstance($type, ss_Nullable$1, [T], {}, function() { return null; }, function() { return []; });
- return $type;
-};
-
-ss_Nullable$1.__typeName = 'ss.Nullable$1';
-ss.Nullable$1 = ss_Nullable$1;
-ss.initGenericClass(ss_Nullable$1, ss, 1);
-
-ss_Nullable$1.eq = function Nullable$eq(a, b) {
- return !ss.isValue(a) ? !ss.isValue(b) : (a === b);
-};
-
-ss_Nullable$1.ne = function Nullable$eq(a, b) {
- return !ss.isValue(a) ? ss.isValue(b) : (a !== b);
-};
-
-ss_Nullable$1.le = function Nullable$le(a, b) {
- return ss.isValue(a) && ss.isValue(b) && a <= b;
-};
-
-ss_Nullable$1.ge = function Nullable$ge(a, b) {
- return ss.isValue(a) && ss.isValue(b) && a >= b;
-};
-
-ss_Nullable$1.lt = function Nullable$lt(a, b) {
- return ss.isValue(a) && ss.isValue(b) && a < b;
-};
-
-ss_Nullable$1.gt = function Nullable$gt(a, b) {
- return ss.isValue(a) && ss.isValue(b) && a > b;
-};
-
-ss_Nullable$1.sub = function Nullable$sub(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a - b : null;
-};
-
-ss_Nullable$1.add = function Nullable$add(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a + b : null;
-};
-
-ss_Nullable$1.mod = function Nullable$mod(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a % b : null;
-};
-
-ss_Nullable$1.div = function Nullable$divf(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a / b : null;
-};
-
-ss_Nullable$1.mul = function Nullable$mul(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a * b : null;
-};
-
-ss_Nullable$1.band = function Nullable$band(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a & b : null;
-};
-
-ss_Nullable$1.bor = function Nullable$bor(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a | b : null;
-};
-
-ss_Nullable$1.xor = function Nullable$xor(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a ^ b : null;
-};
-
-ss_Nullable$1.shl = function Nullable$shl(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a << b : null;
-};
-
-ss_Nullable$1.srs = function Nullable$srs(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a >> b : null;
-};
-
-ss_Nullable$1.sru = function Nullable$sru(a, b) {
- return ss.isValue(a) && ss.isValue(b) ? a >>> b : null;
-};
-
-ss_Nullable$1.and = function Nullable$and(a, b) {
- if (a === true && b === true)
- return true;
- else if (a === false || b === false)
- return false;
- else
- return null;
-};
-
-ss_Nullable$1.or = function Nullable$or(a, b) {
- if (a === true || b === true)
- return true;
- else if (a === false && b === false)
- return false;
- else
- return null;
-};
-
-ss_Nullable$1.not = function Nullable$not(a) {
- return ss.isValue(a) ? !a : null;
-};
-
-ss_Nullable$1.neg = function Nullable$neg(a) {
- return ss.isValue(a) ? -a : null;
-};
-
-ss_Nullable$1.pos = function Nullable$pos(a) {
- return ss.isValue(a) ? +a : null;
-};
-
-ss_Nullable$1.cpl = function Nullable$cpl(a) {
- return ss.isValue(a) ? ~a : null;
-};
-
-ss_Nullable$1.lift = function Nullable$lift() {
- for (var i = 0; i < arguments.length; i++) {
- if (!ss.isValue(arguments[i]))
- return null;
- }
- return arguments[0].apply(null, Array.prototype.slice.call(arguments, 1));
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IList
-
-var ss_IList = function IList$() { };
-
-ss_IList.__typeName = 'ss.IList';
-ss.IList = ss_IList;
-ss.initInterface(ss_IList, ss, { get_item: null, set_item: null, indexOf: null, insert: null, removeAt: null }, [ss_ICollection, ss_IEnumerable]);
-
-ss.getItem = function ss$getItem(obj, index) {
- return obj.get_item ? obj.get_item(index) : obj[index];
-}
-
-ss.setItem = function ss$setItem(obj, index, value) {
- obj.set_item ? obj.set_item(index, value) : (obj[index] = value);
-}
-
-ss.indexOf = function ss$indexOf(obj, item) {
- if (ss.isArrayOrTypedArray(obj)) {
- for (var i = 0; i < obj.length; i++) {
- if (ss.staticEquals(obj[i], item)) {
- return i;
- }
- }
- return -1;
- }
- else
- return obj.indexOf(item);
-};
-
-ss.insert = function ss$insert(obj, index, item) {
- if (obj.insert)
- obj.insert(index, item);
- else if (ss.isArray(obj))
- obj.splice(index, 0, item);
- else
- throw new ss_NotSupportedException();
-};
-
-ss.removeAt = function ss$removeAt(obj, index) {
- if (obj.removeAt)
- obj.removeAt(index);
- else if (ss.isArray(obj))
- obj.splice(index, 1);
- else
- throw new ss_NotSupportedException();
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IDictionary
-
-var ss_IDictionary = function IDictionary$() { };
-
-ss_IDictionary.__typeName = 'ss.IDictionary';
-ss.IDictionary = ss_IDictionary;
-ss.initInterface(ss_IDictionary, ss, { get_item: null, set_item: null, get_keys: null, get_values: null, containsKey: null, add: null, remove: null, tryGetValue: null }, [ss_IEnumerable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// Int32
-
-var ss_Int32 = function Int32$() { };
-
-ss_Int32.__typeName = 'ss.Int32';
-ss.Int32 = ss_Int32;
-ss.initClass(ss_Int32, ss, {}, Object, [ ss_IEquatable, ss_IComparable, ss_IFormattable ]);
-ss_Int32.__class = false;
-
-ss_Int32.isInstanceOfType = function Int32$isInstanceOfType(instance) {
- return typeof(instance) === 'number' && isFinite(instance) && Math.round(instance, 0) == instance;
-};
-
-ss_Int32.getDefaultValue = ss_Int32.createInstance = function Int32$getDefaultValue() {
- return 0;
-};
-
-ss_Int32.div = function Int32$div(a, b) {
- if (!ss.isValue(a) || !ss.isValue(b)) return null;
- if (b === 0) throw new ss_DivideByZeroException();
- return a / b | 0;
-};
-
-ss_Int32.trunc = function Int32$trunc(n) {
- return ss.isValue(n) ? n | 0 : null;
-};
-
-ss_Int32.tryParse = function Int32$tryParse(s, result, min, max) {
- result.$ = 0;
- if (!/^[+-]?[0-9]+$/.test(s))
- return 0;
- var n = parseInt(s);
- if (n < min || n > max)
- return false;
- result.$ = n;
- return true;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// MutableDateTime
-
-var ss_JsDate = function JsDate$() { };
-
-ss_JsDate.__typeName = 'ss.JsDate';
-ss.JsDate = ss_JsDate;
-ss.initClass(ss_JsDate, ss, {}, Object, [ ss_IEquatable, ss_IComparable ]);
-
-ss_JsDate.createInstance = function JsDate$createInstance() {
- return new Date();
-};
-
-ss_JsDate.isInstanceOfType = function JsDate$isInstanceOfType(instance) {
- return instance instanceof Date;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// ArrayEnumerator
-
-var ss_ArrayEnumerator = function ArrayEnumerator$(array) {
- this._array = array;
- this._index = -1;
-};
-ss_ArrayEnumerator.__typeName = 'ss.ArrayEnumerator';
-ss.ArrayEnumerator = ss_ArrayEnumerator;
-ss.initClass(ss_ArrayEnumerator, ss, {
- moveNext: function ArrayEnumerator$moveNext() {
- this._index++;
- return (this._index < this._array.length);
- },
- reset: function ArrayEnumerator$reset() {
- this._index = -1;
- },
- current: function ArrayEnumerator$current() {
- if (this._index < 0 || this._index >= this._array.length)
- throw 'Invalid operation';
- return this._array[this._index];
- },
- dispose: function ArrayEnumerator$dispose() {
- }
-}, null, [ss_IEnumerator, ss_IDisposable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// ObjectEnumerator
-
-var ss_ObjectEnumerator = function ObjectEnumerator$(o) {
- this._keys = Object.keys(o);
- this._index = -1;
- this._object = o;
-};
-
-ss_ObjectEnumerator.__typeName = 'ss.ObjectEnumerator';
-ss.ObjectEnumerator = ss_ObjectEnumerator;
-ss.initClass(ss_ObjectEnumerator, ss, {
- moveNext: function ObjectEnumerator$moveNext() {
- this._index++;
- return (this._index < this._keys.length);
- },
- reset: function ObjectEnumerator$reset() {
- this._index = -1;
- },
- current: function ObjectEnumerator$current() {
- if (this._index < 0 || this._index >= this._keys.length)
- throw new ss_InvalidOperationException('Invalid operation');
- var k = this._keys[this._index];
- return { key: k, value: this._object[k] };
- },
- dispose: function ObjectEnumerator$dispose() {
- }
-}, null, [ss_IEnumerator, ss_IDisposable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// EqualityComparer
-
-var ss_EqualityComparer = function EqualityComparer$() {
-};
-ss_EqualityComparer.__typeName = 'ss.EqualityComparer';
-ss.EqualityComparer = ss_EqualityComparer;
-ss.initClass(ss_EqualityComparer, ss, {
- areEqual: function EqualityComparer$areEqual(x, y) {
- return ss.staticEquals(x, y);
- },
- getObjectHashCode: function EqualityComparer$getObjectHashCode(obj) {
- return ss.isValue(obj) ? ss.getHashCode(obj) : 0;
- }
-}, null, [ss_IEqualityComparer]);
-ss_EqualityComparer.def = new ss_EqualityComparer();
-
-///////////////////////////////////////////////////////////////////////////////
-// Comparer
-
-var ss_Comparer = function Comparer$(f) {
- this.f = f;
-};
-
-ss_Comparer.__typeName = 'ss.Comparer';
-ss.Comparer = ss_Comparer;
-ss.initClass(ss_Comparer, ss, {
- compare: function Comparer$compare(x, y) {
- return this.f(x, y);
- }
-}, null, [ss_IComparer]);
-ss_Comparer.def = new ss_Comparer(function Comparer$defaultCompare(a, b) {
- if (!ss.isValue(a))
- return !ss.isValue(b)? 0 : -1;
- else if (!ss.isValue(b))
- return 1;
- else
- return ss.compare(a, b);
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// Dictionary
-var ss_$DictionaryCollection = function $DictionaryCollection$(dict, isKeys) {
- this._dict = dict;
- this._isKeys = isKeys;
-};
-
-var ss_Dictionary$2 = function Dictionary$2$(TKey, TValue) {
- var $type = function(o, cmp) {
- this.countField = 0;
- this.buckets = {};
-
- this.comparer = cmp || ss_EqualityComparer.def;
-
- if (ss.isInstanceOfType(o, ss_IDictionary)) {
- var e = ss.getEnumerator(o);
- try {
- while (e.moveNext()) {
- var c = e.current();
- this.add(c.key, c.value);
- }
- }
- finally {
- if (ss.isInstanceOfType(e, ss_IDisposable)) {
- ss.cast(e, ss_IDisposable).dispose();
- }
- }
- }
- else if (o) {
- var keys = Object.keys(o);
- for (var i = 0; i < keys.length; i++) {
- this.add(keys[i], o[keys[i]]);
- }
- }
- };
-
- ss.registerGenericClassInstance($type, ss_Dictionary$2, [TKey, TValue], {
- _setOrAdd: function(key, value, add) {
- var hash = this.comparer.getObjectHashCode(key);
- var entry = { key: key, value: value };
- if (this.buckets.hasOwnProperty(hash)) {
- var array = this.buckets[hash];
- for (var i = 0; i < array.length; i++) {
- if (this.comparer.areEqual(array[i].key, key)) {
- if (add)
- throw new ss_ArgumentException('Key ' + key + ' already exists.');
- array[i] = entry;
- return;
- }
- }
- array.push(entry);
- } else {
- this.buckets[hash] = [entry];
- }
- this.countField++;
- },
-
- add: function(key, value) {
- this._setOrAdd(key, value, true);
- },
-
- set_item: function(key, value) {
- this._setOrAdd(key, value, false);
- },
-
- _get: function(key) {
- var hash = this.comparer.getObjectHashCode(key);
- if (this.buckets.hasOwnProperty(hash)) {
- var array = this.buckets[hash];
- for (var i = 0; i < array.length; i++) {
- var entry = array[i];
- if (this.comparer.areEqual(entry.key, key))
- return entry.value !== undefined ? entry.value : null;
- }
- }
- return undefined;
- },
-
- get_item: function(key) {
- var v = this._get(key);
- if (v === undefined)
- throw new ss_KeyNotFoundException('Key ' + key + ' does not exist.');
- return v;
- },
-
- tryGetValue: function(key, value) {
- var v = this._get(key);
- if (v !== undefined) {
- value.$ = v;
- return true;
- }
- else {
- value.$ = ss.getDefaultValue(TValue);
- return false;
- }
- },
-
- containsKey: function(key) {
- var hash = this.comparer.getObjectHashCode(key);
- if (!this.buckets.hasOwnProperty(hash))
- return false;
-
- var array = this.buckets[hash];
- for (var i = 0; i < array.length; i++) {
- if (this.comparer.areEqual(array[i].key, key))
- return true;
- }
- return false;
- },
-
- clear: function() {
- this.countField = 0;
- this.buckets = {};
- },
-
- remove: function(key) {
- var hash = this.comparer.getObjectHashCode(key);
- if (!this.buckets.hasOwnProperty(hash))
- return false;
-
- var array = this.buckets[hash];
- for (var i = 0; i < array.length; i++) {
- if (this.comparer.areEqual(array[i].key, key)) {
- array.splice(i, 1);
- if (array.length == 0) delete this.buckets[hash];
- this.countField--;
- return true;
- }
- }
- return false;
- },
-
- get_count: function() {
- return this.countField;
- },
-
- _getEnumerator: function(projector) {
- var bucketKeys = Object.keys(this.buckets), bucketIndex = -1, arrayIndex;
- return new ss_IteratorBlockEnumerator(function() {
- if (bucketIndex < 0 || arrayIndex >= (this.buckets[bucketKeys[bucketIndex]].length - 1)) {
- arrayIndex = -1;
- bucketIndex++;
- }
- if (bucketIndex >= bucketKeys.length)
- return false;
- arrayIndex++;
- return true;
- }, function() { return projector(this.buckets[bucketKeys[bucketIndex]][arrayIndex]); }, null, this);
- },
-
- get_keys: function() {
- return new ss_$DictionaryCollection(this, true);
- },
-
- get_values: function() {
- return new ss_$DictionaryCollection(this, false);
- },
-
- getEnumerator: function() {
- return this._getEnumerator(function(e) { return e; });
- }
- }, function() { return null; }, function() { return [ ss_IDictionary, ss_IEnumerable ]; });
- return $type;
-};
-
-ss_Dictionary$2.__typeName = 'ss.Dictionary$2';
-ss.Dictionary$2 = ss_Dictionary$2;
-ss.initGenericClass(ss_Dictionary$2, ss, 2);
-ss_$DictionaryCollection.__typeName = 'ss.$DictionaryCollection';
-ss.$DictionaryCollection = ss_$DictionaryCollection;
-ss.initClass(ss_$DictionaryCollection, ss, {
- get_count: function $DictionaryCollection$get_count() {
- return this._dict.get_count();
- },
- contains: function $DictionaryCollection$contains(v) {
- if (this._isKeys) {
- return this._dict.containsKey(v);
- }
- else {
- for (var e in this._dict.buckets) {
- if (this._dict.buckets.hasOwnProperty(e)) {
- var bucket = this._dict.buckets[e];
- for (var i = 0; i < bucket.length; i++) {
- if (this._dict.comparer.areEqual(bucket[i].value, v))
- return true;
- }
- }
- }
- return false;
- }
- },
- getEnumerator: function $DictionaryCollection$getEnumerator(v) {
- return this._dict._getEnumerator(this._isKeys ? function(e) { return e.key; } : function(e) { return e.value; });
- },
- add: function $DictionaryCollection$add(v) {
- throw new ss_InvalidOperationException('Collection is read-only');
- },
- clear: function $DictionaryCollection$clear() {
- throw new ss_InvalidOperationException('Collection is read-only');
- },
- remove: function $DictionaryCollection$remove() {
- throw new ss_InvalidOperationException('Collection is read-only');
- }
-}, null, [ss_IEnumerable, ss_ICollection]);
-
-///////////////////////////////////////////////////////////////////////////////
-// IDisposable
-
-var ss_IDisposable = function IDisposable$() { };
-ss_IDisposable.__typeName = 'ss.IDisposable';
-ss.IDisposable = ss_IDisposable;
-ss.initInterface(ss_IDisposable, ss, { dispose: null });
-
-///////////////////////////////////////////////////////////////////////////////
-// StringBuilder
-
-var ss_StringBuilder = function StringBuilder$(s) {
- this._parts = (ss.isValue(s) && s != '') ? [s] : [];
- this.length = ss.isValue(s) ? s.length : 0;
-}
-
-ss_StringBuilder.__typeName = 'ss.StringBuilder';
-ss.StringBuilder = ss_StringBuilder;
-ss.initClass(ss_StringBuilder, ss, {
- append: function StringBuilder$append(o) {
- if (ss.isValue(o)) {
- var s = o.toString();
- ss.add(this._parts, s);
- this.length += s.length;
- }
- return this;
- },
-
- appendChar: function StringBuilder$appendChar(c) {
- return this.append(String.fromCharCode(c));
- },
-
- appendLine: function StringBuilder$appendLine(s) {
- this.append(s);
- this.append('\r\n');
- return this;
- },
-
- appendLineChar: function StringBuilder$appendLineChar(c) {
- return this.appendLine(String.fromCharCode(c));
- },
-
- clear: function StringBuilder$clear() {
- this._parts = [];
- this.length = 0;
- },
-
- toString: function StringBuilder$toString() {
- return this._parts.join('');
- }
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// Random
-
-var ss_Random = function Random$(seed) {
- var _seed = (seed === undefined) ? parseInt(Date.now() % 2147483648) : parseInt(Math.abs(seed));
- this.inext = 0;
- this.inextp = 21;
- this.seedArray = new Array(56);
- for(var i = 0; i < 56; i++)
- this.seedArray[i] = 0;
-
- _seed = 161803398 - _seed;
- if (_seed < 0)
- _seed += 2147483648;
- this.seedArray[55] = _seed;
- var mk = 1;
- for (var i = 1; i < 55; i++) {
- var ii = (21 * i) % 55;
- this.seedArray[ii] = mk;
- mk = _seed - mk;
- if (mk < 0)
- mk += 2147483648;
-
- _seed = this.seedArray[ii];
- }
- for (var j = 1; j < 5; j++) {
- for (var k = 1; k < 56; k++) {
- this.seedArray[k] -= this.seedArray[1 + (k + 30) % 55];
- if (this.seedArray[k] < 0)
- this.seedArray[k] += 2147483648;
- }
- }
-};
-
-ss_Random.__typeName = 'ss.Random';
-ss.Random = ss_Random;
-ss.initClass(ss_Random, ss, {
- next: function Random$next() {
- return this.sample() * 2147483648 | 0;
- },
- nextMax: function Random$nextMax(max) {
- return this.sample() * max | 0;
- },
- nextMinMax: function Random$nextMinMax(min, max) {
- return (this.sample() * (max - min) + min) | 0;
- },
- nextBytes: function Random$nextBytes(bytes) {
- for (var i = 0; i < bytes.length; i++)
- bytes[i] = (this.sample() * 256) | 0;
- },
- nextDouble: function Random$nextDouble() {
- return this.sample();
- },
- sample: function Random$sample() {
- if (++this.inext >= 56)
- this.inext = 1;
- if (++this.inextp >= 56)
- this.inextp = 1;
-
- var retVal = this.seedArray[this.inext] - this.seedArray[this.inextp];
-
- if (retVal < 0)
- retVal += 2147483648;
-
- this.seedArray[this.inext] = retVal;
-
- return retVal * (1.0 / 2147483648);
- }
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// EventArgs
-
-var ss_EventArgs = function EventArgs$() {
-}
-ss_EventArgs.__typeName = 'ss.EventArgs';
-ss.EventArgs = ss_EventArgs;
-ss.initClass(ss_EventArgs, ss, {});
-
-ss_EventArgs.Empty = new ss_EventArgs();
-
-///////////////////////////////////////////////////////////////////////////////
-// Exception
-
-var ss_Exception = function Exception$(message, innerException) {
- this._message = message || 'An error occurred.';
- this._innerException = innerException || null;
-}
-
-ss_Exception.__typeName = 'ss.Exception';
-ss.Exception = ss_Exception;
-ss.initClass(ss_Exception, ss, {
- get_message: function Exception$get_message() {
- return this._message;
- },
- get_innerException: function Exception$get_innerException() {
- return this._innerException;
- }
-});
-
-ss_Exception.wrap = function Exception$wrap(o) {
- if (ss.isInstanceOfType(o, ss_Exception)) {
- return o;
- }
- else if (o instanceof TypeError) {
- // TypeError can either be 'cannot read property blah of null/undefined' (proper NullReferenceException), or it can be eg. accessing a non-existent method of an object.
- // As long as all code is compiled, they should with a very high probability indicate the use of a null reference.
- return new ss_NullReferenceException(o.message);
- }
- else if (o instanceof RangeError) {
- return new ss_ArgumentOutOfRangeException(null, o.message);
- }
- else if (o instanceof Error) {
- return new ss_JsErrorException(o);
- }
- else {
- return new ss_Exception(o.toString());
- }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// NotImplementedException
-
-var ss_NotImplementedException = function NotImplementedException$(message, innerException) {
- ss_Exception.call(this, message || 'The method or operation is not implemented.', innerException);
-};
-ss_NotImplementedException.__typeName = 'ss.NotImplementedException';
-ss.NotImplementedException = ss_NotImplementedException;
-ss.initClass(ss_NotImplementedException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// NotSupportedException
-
-var ss_NotSupportedException = function NotSupportedException$(message, innerException) {
- ss_Exception.call(this, message || 'Specified method is not supported.', innerException);
-};
-ss_NotSupportedException.__typeName = 'ss.NotSupportedException';
-ss.NotSupportedException = ss_NotSupportedException;
-ss.initClass(ss_NotSupportedException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// AggregateException
-
-var ss_AggregateException = function AggregateException$(message, innerExceptions) {
- this.innerExceptions = ss.isValue(innerExceptions) ? ss.arrayFromEnumerable(innerExceptions) : [];
- ss_Exception.call(this, message || 'One or more errors occurred.', this.innerExceptions.length ? this.innerExceptions[0] : null);
-};
-
-ss_AggregateException.__typeName = 'ss.AggregateException';
-ss.AggregateException = ss_AggregateException;
-ss.initClass(ss_AggregateException, ss, {
- flatten: function AggregateException$flatten() {
- var inner = [];
- for (var i = 0; i < this.innerExceptions.length; i++) {
- var e = this.innerExceptions[i];
- if (ss.isInstanceOfType(e, ss_AggregateException)) {
- inner.push.apply(inner, e.flatten().innerExceptions);
- }
- else {
- inner.push(e);
- }
- }
- return new ss_AggregateException(this._message, inner);
- }
-}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// PromiseException
-
-var ss_PromiseException = function PromiseException(args, message, innerException) {
- ss_Exception.call(this, message || (args.length && args[0] ? args[0].toString() : 'An error occurred'), innerException);
- this.arguments = ss.arrayClone(args);
-};
-
-ss_PromiseException.__typeName = 'ss.PromiseException';
-ss.PromiseException = ss_PromiseException;
-ss.initClass(ss_PromiseException, ss, {
- get_arguments: function PromiseException$get_arguments() {
- return this._arguments;
- }
-}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// JsErrorException
-
-var ss_JsErrorException = function JsErrorException$(error, message, innerException) {
- ss_Exception.call(this, message || error.message, innerException);
- this.error = error;
-};
-ss_JsErrorException.__typeName = 'ss.JsErrorException';
-ss.JsErrorException = ss_JsErrorException;
-ss.initClass(ss_JsErrorException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// ArgumentException
-
-var ss_ArgumentException = function ArgumentException$(message, paramName, innerException) {
- ss_Exception.call(this, message || 'Value does not fall within the expected range.', innerException);
- this.paramName = paramName || null;
-};
-
-ss_ArgumentException.__typeName = 'ss.ArgumentException';
-ss.ArgumentException = ss_ArgumentException;
-ss.initClass(ss_ArgumentException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// ArgumentNullException
-
-var ss_ArgumentNullException = function ArgumentNullException$(paramName, message, innerException) {
- if (!message) {
- message = 'Value cannot be null.';
- if (paramName)
- message += '\nParameter name: ' + paramName;
- }
-
- ss_ArgumentException.call(this, message, paramName, innerException);
-};
-
-ss_ArgumentNullException.__typeName = 'ss.ArgumentNullException';
-ss.ArgumentNullException = ss_ArgumentNullException;
-ss.initClass(ss_ArgumentNullException, ss, {}, ss_ArgumentException);
-
-////////////////////////////////////////////////////////////////////////////////
-// ArgumentNullException
-
-var ss_ArgumentOutOfRangeException = function ArgumentOutOfRangeException$(paramName, message, innerException, actualValue) {
- if (!message) {
- message = 'Value is out of range.';
- if (paramName)
- message += '\nParameter name: ' + paramName;
- }
-
- ss_ArgumentException.call(this, message, paramName, innerException);
- this.actualValue = actualValue || null;
-};
-
-ss_ArgumentOutOfRangeException.__typeName = 'ss.ArgumentOutOfRangeException';
-ss.ArgumentOutOfRangeException = ss_ArgumentOutOfRangeException;
-ss.initClass(ss_ArgumentOutOfRangeException, ss, {}, ss_ArgumentException);
-
-////////////////////////////////////////////////////////////////////////////////
-// FormatException
-
-var ss_FormatException = function FormatException$(message, innerException) {
- ss_Exception.call(this, message || 'Invalid format.', innerException);
-};
-ss_FormatException.__typeName = 'ss.FormatException';
-ss.FormatException = ss_FormatException;
-ss.initClass(ss_FormatException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// DivideByZeroException
-
-var ss_DivideByZeroException = function DivideByZeroException$(message, innerException) {
- ss_Exception.call(this, message || 'Division by 0.', innerException);
-};
-ss_DivideByZeroException.__typeName = 'ss.DivideByZeroException';
-ss.DivideByZeroException = ss_DivideByZeroException;
-ss.initClass(ss_DivideByZeroException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// InvalidCastException
-
-var ss_InvalidCastException = function InvalidCastException$(message, innerException) {
- ss_Exception.call(this, message || 'The cast is not valid.', innerException);
-};
-ss_InvalidCastException.__typeName = 'ss.InvalidCastException';
-ss.InvalidCastException = ss_InvalidCastException;
-ss.initClass(ss_InvalidCastException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// InvalidOperationException
-
-var ss_InvalidOperationException = function InvalidOperationException$(message, innerException) {
- ss_Exception.call(this, message || 'Operation is not valid due to the current state of the object.', innerException);
-};
-ss_InvalidOperationException.__typeName = 'ss.InvalidOperationException';
-ss.InvalidOperationException = ss_InvalidOperationException;
-ss.initClass(ss_InvalidOperationException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// NullReferenceException
-
-var ss_NullReferenceException = function NullReferenceException$(message, innerException) {
- ss_Exception.call(this, message || 'Object is null.', innerException);
-};
-ss_NullReferenceException.__typeName = 'ss.NullReferenceException';
-ss.NullReferenceException = ss_NullReferenceException;
-ss.initClass(ss_NullReferenceException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// KeyNotFoundException
-
-var ss_KeyNotFoundException = function KeyNotFoundException$(message, innerException) {
- ss_Exception.call(this, message || 'Key not found.', innerException);
-};
-ss_KeyNotFoundException.__typeName = 'ss.KeyNotFoundException';
-ss.KeyNotFoundException = ss_KeyNotFoundException;
-ss.initClass(ss_KeyNotFoundException, ss, {}, ss_Exception);
-
-////////////////////////////////////////////////////////////////////////////////
-// InvalidOperationException
-
-var ss_AmbiguousMatchException = function AmbiguousMatchException$(message, innerException) {
- ss_Exception.call(this, message || 'Ambiguous match.', innerException);
-};
-ss_AmbiguousMatchException.__typeName = 'ss.AmbiguousMatchException';
-ss.AmbiguousMatchException = ss_AmbiguousMatchException;
-ss.initClass(ss_AmbiguousMatchException, ss, {}, ss_Exception);
-
-///////////////////////////////////////////////////////////////////////////////
-// IteratorBlockEnumerable
-
-var ss_IteratorBlockEnumerable = function IteratorBlockEnumerable$(getEnumerator, $this) {
- this._getEnumerator = getEnumerator;
- this._this = $this;
-};
-
-ss_IteratorBlockEnumerable.__typeName = 'ss.IteratorBlockEnumerable';
-ss.IteratorBlockEnumerable = ss_IteratorBlockEnumerable;
-ss.initClass(ss_IteratorBlockEnumerable, ss, {
- getEnumerator: function IteratorBlockEnumerable$getEnumerator() {
- return this._getEnumerator.call(this._this);
- }
-}, null, [ss_IEnumerable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// IteratorBlockEnumerator
-
-var ss_IteratorBlockEnumerator = function IteratorBlockEnumerator$(moveNext, getCurrent, dispose, $this) {
- this._moveNext = moveNext;
- this._getCurrent = getCurrent;
- this._dispose = dispose;
- this._this = $this;
-};
-
-ss_IteratorBlockEnumerator.__typeName = 'ss.IteratorBlockEnumerator';
-ss.IteratorBlockEnumerator = ss_IteratorBlockEnumerator;
-ss.initClass(ss_IteratorBlockEnumerator, ss, {
- moveNext: function IteratorBlockEnumerator$moveNext() {
- try {
- return this._moveNext.call(this._this);
- }
- catch (ex) {
- if (this._dispose)
- this._dispose.call(this._this);
- throw ex;
- }
- },
- current: function IteratorBlockEnumerator$current() {
- return this._getCurrent.call(this._this);
- },
- reset: function IteratorBlockEnumerator$reset() {
- throw new ss_NotSupportedException('Reset is not supported.');
- },
- dispose: function IteratorBlockEnumerator$dispose() {
- if (this._dispose)
- this._dispose.call(this._this);
- }
-}, null, [ss_IEnumerator, ss_IDisposable]);
-
-///////////////////////////////////////////////////////////////////////////////
-// Lazy
-
-var ss_Lazy = function Lazy$(valueFactory) {
- this._valueFactory = valueFactory;
- this.isValueCreated = false;
-};
-ss_Lazy.__typeName = 'ss.Lazy';
-ss.Lazy = ss_Lazy;
-ss.initClass(ss_Lazy, ss, {
- value: function Lazy$value() {
- if (!this.isValueCreated) {
- this._value = this._valueFactory();
- delete this._valueFactory;
- this.isValueCreated = true;
- }
- return this._value;
- }
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// Task
-
-var ss_Task = function Task$(action, state) {
- this._action = action;
- this._state = state;
- this.exception = null;
- this.status = 0;
- this._thens = [];
- this._result = null;
-};
-
-ss_Task.delay = function Task$delay(delay) {
- var tcs = new ss_TaskCompletionSource();
- setTimeout(function() {
- tcs.setResult(0);
- }, delay);
- return tcs.task;
-};
-
-ss_Task.fromResult = function Task$fromResult(result) {
- var t = new ss_Task();
- t.status = 5;
- t._result = result;
- return t;
-};
-
-ss_Task.run = function Task$fromResult(f) {
- var tcs = new ss_TaskCompletionSource();
- setTimeout(function() {
- try {
- tcs.setResult(f());
- }
- catch (e) {
- tcs.setException(ss_Exception.wrap(e));
- }
- }, 0);
- return tcs.task;
-};
-
-ss_Task.whenAll = function Task$whenAll(tasks) {
- var tcs = new ss_TaskCompletionSource();
- if (tasks.length === 0) {
- tcs.setResult([]);
- }
- else {
- var result = new Array(tasks.length), remaining = tasks.length, cancelled = false, exceptions = [];
- for (var i = 0; i < tasks.length; i++) {
- (function(i) {
- tasks[i].continueWith(function(t) {
- switch (t.status) {
- case 5:
- result[i] = t.getResult();
- break;
- case 6:
- cancelled = true;
- break;
- case 7:
- ss.arrayAddRange(exceptions, t.exception.innerExceptions);
- break;
- default:
- throw new ss_InvalidOperationException('Invalid task status ' + t.status);
- }
- if (--remaining === 0) {
- if (exceptions.length > 0)
- tcs.setException(exceptions);
- else if (cancelled)
- tcs.setCanceled();
- else
- tcs.setResult(result);
- }
- });
- })(i);
- }
- }
- return tcs.task;
-};
-
-ss_Task.whenAny = function Task$whenAny(tasks) {
- if (!tasks.length)
- throw new ss_ArgumentException('Must wait for at least one task', 'tasks');
-
- var tcs = new ss_TaskCompletionSource();
- for (var i = 0; i < tasks.length; i++) {
- tasks[i].continueWith(function(t) {
- switch (t.status) {
- case 5:
- tcs.trySetResult(t);
- break;
- case 6:
- tcs.trySetCanceled();
- break;
- case 7:
- tcs.trySetException(t.exception.innerExceptions);
- break;
- default:
- throw new ss_InvalidOperationException('Invalid task status ' + t.status);
- }
- });
- }
- return tcs.task;
-};
-
-ss_Task.fromDoneCallback = function Task$fromDoneCallback(t, i, m) {
- var tcs = new ss_TaskCompletionSource(), args;
- if (typeof(i) === 'number') {
- args = Array.prototype.slice.call(arguments, 3);
- if (i < 0)
- i += args.length + 1;
- }
- else {
- args = Array.prototype.slice.call(arguments, 2);
- m = i;
- i = args.length;
- }
-
- var cb = function(v) {
- tcs.setResult(v);
- };
-
- args = args.slice(0, i).concat(cb, args.slice(i));
-
- t[m].apply(t, args);
- return tcs.task;
-};
-
-ss_Task.fromPromise = function Task$fromPromise(p, f) {
- var tcs = new ss_TaskCompletionSource();
- if (typeof(f) === 'number')
- f = (function(i) { return function() { return arguments[i >= 0 ? i : (arguments.length + i)]; }; })(f);
- else if (typeof(f) !== 'function')
- f = function() { return Array.prototype.slice.call(arguments, 0); };
-
- p.then(function() {
- tcs.setResult(typeof(f) === 'function' ? f.apply(null, arguments) : null);
- }, function() {
- tcs.setException(new ss_PromiseException(Array.prototype.slice.call(arguments, 0)));
- });
- return tcs.task;
-};
-
-ss_Task.fromNode = function Task$fromNode(t, f, m) {
- var tcs = new ss_TaskCompletionSource(), args;
- if (typeof(f) === 'function') {
- args = Array.prototype.slice.call(arguments, 3);
- }
- else {
- args = Array.prototype.slice.call(arguments, 2);
- m = f;
- f = function() { return arguments[0]; };
- }
-
- var cb = function(e) {
- if (e)
- tcs.setException(ss_Exception.wrap(e));
- else
- tcs.setResult(f.apply(null, Array.prototype.slice.call(arguments, 1)));
- };
-
- args.push(cb);
-
- t[m].apply(t, args);
- return tcs.task;
-};
-
-ss_Task.__typeName = 'ss.Task';
-ss.Task = ss_Task;
-ss.initClass(ss_Task, ss, {
- continueWith: function Task$continueWith(continuation) {
- var tcs = new ss_TaskCompletionSource();
- var _this = this;
- var fn = function() {
- try {
- tcs.setResult(continuation(_this));
- }
- catch (e) {
- tcs.setException(ss_Exception.wrap(e));
- }
- };
- if (this.isCompleted()) {
- setTimeout(fn, 0);
- }
- else {
- this._thens.push(fn);
- }
- return tcs.task;
- },
- start: function Task$start() {
- if (this.status !== 0)
- throw new ss_InvalidOperationException('Task was already started.');
- var _this = this;
- this.status = 3;
- setTimeout(function() {
- try {
- var result = _this._action(_this._state);
- delete _this._action;
- delete _this._state;
- _this._complete(result);
- }
- catch (e) {
- _this._fail(new ss_AggregateException(null, [ss_Exception.wrap(e)]));
- }
- }, 0);
- },
- _runCallbacks: function Task$_runCallbacks() {
- for (var i = 0; i < this._thens.length; i++)
- this._thens[i](this);
- delete this._thens;
- },
- _complete: function Task$_complete(result) {
- if (this.isCompleted())
- return false;
- this._result = result;
- this.status = 5;
- this._runCallbacks();
- return true;
- },
- _fail: function Task$_fail(exception) {
- if (this.isCompleted())
- return false;
- this.exception = exception;
- this.status = 7;
- this._runCallbacks();
- return true;
- },
- _cancel: function Task$_cancel() {
- if (this.isCompleted())
- return false;
- this.status = 6;
- this._runCallbacks();
- return true;
- },
- isCanceled: function Task$isCanceled() {
- return this.status === 6;
- },
- isCompleted: function Task$isCompleted() {
- return this.status >= 5;
- },
- isFaulted: function Task$isFaulted() {
- return this.status === 7;
- },
- _getResult: function Task$_getResult(await) {
- switch (this.status) {
- case 5:
- return this._result;
- case 6:
- throw new ss_InvalidOperationException('Task was cancelled.');
- case 7:
- throw await ? this.exception.innerExceptions[0] : this.exception;
- default:
- throw new ss_InvalidOperationException('Task is not yet completed.');
- }
- },
- getResult: function Task$getResult() {
- return this._getResult(false);
- },
- getAwaitedResult: function Task$getAwaitedResult() {
- return this._getResult(true);
- },
- dispose: function Task$dispose() {
- }
-}, null, [ss_IDisposable]);
-
-////////////////////////////////////////////////////////////////////////////////
-// TaskStatus
-var ss_TaskStatus = function() {
-};
-ss_TaskStatus.__typeName = 'ss.TaskStatus';
-ss.TaskStatus = ss_TaskStatus;
-ss.initEnum(ss_TaskStatus, ss, { created: 0, running: 3, ranToCompletion: 5, canceled: 6, faulted: 7 });
-
-///////////////////////////////////////////////////////////////////////////////
-// TaskCompletionSource
-
-var ss_TaskCompletionSource = function TaskCompletionSource$() {
- this.task = new ss_Task();
- this.task.status = 3;
-};
-
-ss_TaskCompletionSource.__typeName = 'ss.TaskCompletionSource';
-ss.TaskCompletionSource = ss_TaskCompletionSource;
-ss.initClass(ss_TaskCompletionSource, ss, {
- setCanceled: function TaskCompletionSource$setCanceled() {
- if (!this.task._cancel())
- throw new ss_InvalidOperationException('Task was already completed.');
- },
- setResult: function TaskCompletionSource$setResult(result) {
- if (!this.task._complete(result))
- throw new ss_InvalidOperationException('Task was already completed.');
- },
- setException: function TaskCompletionSource$setException(exception) {
- if (!this.trySetException(exception))
- throw new ss_InvalidOperationException('Task was already completed.');
- },
- trySetCanceled: function TaskCompletionSource$trySetCanceled() {
- return this.task._cancel();
- },
- trySetResult: function TaskCompletionSource$setResult(result) {
- return this.task._complete(result);
- },
- trySetException: function TaskCompletionSource$setException(exception) {
- if (ss.isInstanceOfType(exception, ss_Exception))
- exception = [exception];
- return this.task._fail(new ss_AggregateException(null, exception));
- }
-});
-
-///////////////////////////////////////////////////////////////////////////////
-// CancelEventArgs
-
-var ss_CancelEventArgs = function CancelEventArgs$() {
- ss_EventArgs.call(this);
- this.cancel = false;
-}
-
-ss_CancelEventArgs.__typeName = 'ss.CancelEventArgs';
-ss.CancelEventArgs = ss_CancelEventArgs;
-ss.initClass(ss_CancelEventArgs, ss, {}, ss_EventArgs);
-
-///////////////////////////////////////////////////////////////////////////////
-// Guid
-
-var ss_Guid = function Guid$() {
-};
-ss_Guid.$valid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ig;
-ss_Guid.$split = /^(.{8})(.{4})(.{4})(.{4})(.{12})$/;
-ss_Guid.empty = '00000000-0000-0000-0000-000000000000';
-ss_Guid.$rng = new ss_Random();
-
-ss_Guid.__typeName = 'ss.Guid';
-ss.Guid = ss_Guid;
-ss.initClass(ss_Guid, ss, {}, Object, [ ss_IEquatable, ss_IComparable ]);
-ss_Guid.__class = false;
-
-ss_Guid.isInstanceOfType = function Guid$isInstanceOfType(instance) {
- return typeof(instance) === 'string' && instance.match(ss_Guid.$valid);
-};
-
-ss_Guid.getDefaultValue = ss_Guid.createInstance = function Guid$default() {
- return ss_Guid.empty;
-};
-
-ss_Guid.parse = function Guid$parse(uuid, format) {
- var r = {};
- if (ss_Guid.tryParse(uuid, format, r))
- return r.$;
- throw new ss_FormatException('Unable to parse UUID');
-};
-
-ss_Guid.tryParse = function Guid$tryParse(uuid, format, r) {
- r.$ = ss_Guid.empty;
- if (!ss.isValue(uuid)) throw new ss_ArgumentNullException('uuid');
- if (!format) {
- var m = /^[{(]?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})[)}]?$/ig.exec(uuid);
- if (m) {
- r.$ = m.slice(1).join('-').toLowerCase();
- return true;
- }
- }
- else {
- if (format === 'N') {
- var m = ss_Guid.$split.exec(uuid);
- if (!m)
- return false;
- uuid = m.slice(1).join('-');
- }
- else if (format === 'B' || format === 'P') {
- var b = format === 'B';
- if (uuid[0] !== (b ? '{' : '(') || uuid[uuid.length - 1] !== (b ? '}' : ')'))
- return false;
- uuid = uuid.substr(1, uuid.length - 2);
- }
- if (uuid.match(ss_Guid.$valid)) {
- r.$ = uuid.toLowerCase();
- return true;
- }
- }
- return false;
-};
-
-ss_Guid.format = function Guid$format(uuid, format) {
- switch (format) {
- case 'N': return uuid.replace(/-/g, '');
- case 'B': return '{' + uuid + '}';
- case 'P': return '(' + uuid + ')';
- default : return uuid;
- }
-}
-
-ss_Guid.fromBytes = function Guid$fromBytes(b) {
- if (!b || b.length !== 16)
- throw new ss_ArgumentException('b', 'Must be 16 bytes');
- var s = b.map(function(x) { return ss.formatNumber(x & 0xff, 'x2'); }).join('');
- return ss_Guid.$split.exec(s).slice(1).join('-');
-}
-
-ss_Guid.newGuid = function Guid$newGuid() {
- var a = Array(16);
- ss_Guid.$rng.nextBytes(a);
- a[6] = a[6] & 0x0f | 0x40;
- a[8] = a[8] & 0xbf | 0x80;
- return ss_Guid.fromBytes(a);
-};
-
-ss_Guid.getBytes = function Guid$getBytes(uuid) {
- var a = Array(16);
- var s = uuid.replace(/-/g, '');
- for (var i = 0; i < 16; i++) {
- a[i] = parseInt(s.substr(i * 2, 2), 16);
- }
- return a;
-};
-
-if (global.ss) {
- for (var n in ss) {
- if (ss.hasOwnProperty(n))
- global.ss[n] = ss[n];
- }
-}
-else {
- global.ss = ss;
-}
-})(global);
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.min.js b/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.min.js
deleted file mode 100644
index de22724..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/mscorlib.min.js
+++ /dev/null
@@ -1 +0,0 @@
-if(typeof global==="undefined")if(typeof window!=="undefined")global=window;else if(typeof self!=="undefined")global=self;(function(k){"use strict";var a={__assemblies:{}};a.initAssembly=function(b,d,c){c=c||{};b.name=d;b.toString=function(){return this.name};b.__types={};b.getResourceNames=function(){return Object.keys(c)};b.getResourceDataBase64=function(a){return c[a]||null};b.getResourceData=function(d){var b=c[d];return b?a.dec64(b):null};a.__assemblies[d]=b};a.initAssembly(a,"mscorlib");a.load=function(b){return a.__assemblies[b]||require(b)};var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D;a.enc64=function(b,g){for(var f="",a=0;a>2]+I[(c&3)<<4|d>>4]+(a>6]:"=")+(a>4;if(d>=0)c[e+1]=(f&15)<<4|d>>2;if(g>=0)c[e+2]=(d&3)<<6|g}return c};a.getAssemblies=function(){return Object.keys(a.__assemblies).map(function(b){return a.__assemblies[b]})};a.isNullOrUndefined=function(a){return a===null||a===undefined};a.isValue=function(a){return a!==null&&a!==undefined};a.referenceEquals=function(b,c){return a.isValue(b)?b===c:!a.isValue(c)};a.mkdict=function(){for(var b=arguments.length!=1?arguments:arguments[0],c={},a=0;a=0};a.isArrayOrTypedArray=function(b){return a.isArray(b)||a.isTypedArrayType(a.getInstanceType(b))};a.getHashCode=function(b){if(!a.isValue(b))throw new p("Cannot get hash code of null");else if(typeof b.getHashCode==="function")return b.getHashCode();else if(typeof b==="boolean")return b?1:0;else if(typeof b==="number"){var c=b.toExponential();c=c.substr(0,c.indexOf("e"));return parseInt(c.replace(".",""),10)&4294967295}else if(typeof b==="string"){for(var d=0,e=0;ec?1:0:a.isDate(b)?a.compare(b.valueOf(),c.valueOf()):b.compareTo(c)};a.equalsT=function(b,c){if(!a.isValue(b))throw new p("Object is null");else return typeof b==="number"||typeof b==="string"||typeof b==="boolean"?b===c:a.isDate(b)?b.valueOf()===c.valueOf():b.equalsT(c)};a.staticEquals=function(c,b){return!a.isValue(c)?!a.isValue(b):a.isValue(b)?a.equals(c,b):false};a.shallowCopy=function(b,e){for(var c=Object.keys(b),a=0,f=c.length;a",b=a.__anonymousCache[d];if(!b){var b=new Function(c.map(function(a){return a[1]}).join(","),c.map(function(a){return"this."+a[1]+"="+a[1]+";"}).join(""));b.__typeName=d;var e=c.map(function(a){return{name:a[1],typeDef:b,type:16,returnType:a[0],getter:{name:"get_"+a[1],typeDef:b,params:[],returnType:a[0],fget:a[1]}}});e.push({name:".ctor",typeDef:b,type:1,params:c.map(function(a){return a[0]})});b.__metadata={members:e};a.__anonymousCache[d]=b}return b};a.setMetadata=function(c,d){if(d.members)for(var e=0;e=0?d:b.length);return c>0?b.substr(c+1):b};a.getTypeNamespace=function(e){var b=a.getTypeFullName(e),d=b.indexOf("["),c=b.lastIndexOf(".",d>=0?d:b.length);return c>0?b.substr(0,c):""};a.getTypeAssembly=function(b){return a.contains([Date,Number,Boolean,String,Function,Array],b)?a:b.__assembly||null};a.getAssemblyType=function(b,d){var f=[];if(b.__types)return b.__types[d]||null;else{for(var e=d.split("."),c=0;c1?a.__assemblies[b[1].trim()]:k;return d?a.getAssemblyType(d,b[0].trim()):null};a.getDefaultValue=function(a){return typeof a.getDefaultValue==="function"?a.getDefaultValue():a===Boolean?false:a===Date?new Date(0):a===Number?0:null};a.createInstance=function(a){return typeof a.createInstance==="function"?a.createInstance():a===Boolean?false:a===Date?new Date(0):a===Number?0:a===String?"":new a};a.applyConstructor=function(a,c){var b=function(){a.apply(this,c)};b.prototype=a.prototype;return new b};a.getAttributes=function(e,h,j){var c=[];if(j){var i=a.getBaseType(e);if(i)for(var d=a.getAttributes(i,h,true),b=0;b=0;g--)a.isInstanceOfType(c[g],f)&&c.splice(g,1);c.push(d)}}return c};a.getMembers=function(b,k,c,h,f){var e=[];if((c&72)==72||(c&6)==4){var m=a.getBaseType(b);if(m)e=a.getMembers(m,k&~1,c&(c&64?255:247)&(c&2?251:255),h,f)}var n=function(a){if(k&a.type&&(c&4&&!a.isStatic||c&8&&a.isStatic)&&(!h||a.name===h)){if(f){if((a.params||[]).length!==f.length)return;for(var b=0;b1)throw new K("Ambiguous match");else if(g.length===1)return g[0];b=a.getBaseType(b)}return null}return e};a.midel=function(b,f,d){if(b.isStatic&&!!f)throw new e("Cannot specify target for static method");else if(!b.isStatic&&!f)throw new e("Must specify target for instance method");var c;if(b.fget)c=function(){return(b.isStatic?b.typeDef:this)[b.fget]};else if(b.fset)c=function(a){(b.isStatic?b.typeDef:this)[b.fset]=a};else{c=b.def||(b.isStatic||b.sm?b.typeDef[b.sname]:f[b.sname]);if(b.tpcount){if(!d||d.length!==b.tpcount)throw new e("Wrong number of type arguments");c=c.apply(null,d)}else if(d&&d.length)throw new e("Cannot specify type arguments for non-generic method");if(b.exp){var g=c;c=function(){return g.apply(this,Array.prototype.slice.call(arguments,0,arguments.length-1).concat(arguments[arguments.length-1]))}}if(b.sm){var h=c;c=function(){return h.apply(null,[this].concat(Array.prototype.slice.call(arguments)))}}}return a.mkdel(f,c)};a.invokeCI=function(b,c){if(b.exp)c=c.slice(0,c.length-1).concat(c[c.length-1]);return b.def?b.def.apply(null,c):b.sm?b.typeDef[b.sname].apply(null,c):a.applyConstructor(b.sname?b.typeDef[b.sname]:b.typeDef,c)};a.fieldAccess=function(b,a){if(b.isStatic&&!!a)throw new e("Cannot specify target for static field");else if(!b.isStatic&&!a)throw new e("Must specify target for instance field");a=b.isStatic?b.typeDef:a;if(arguments.length===3)a[b.sname]=arguments[2];else return a[b.sname]};var z=function(){};z.__typeName="ss.IFormattable";a.IFormattable=z;a.initInterface(z,a,{format:null});a.format=function(b,c){return typeof b==="number"?a.formatNumber(b,c):a.isDate(b)?a.formatDate(b,c):b.format(c)};var r=function(){};r.__typeName="ss.IComparable";a.IComparable=r;a.initInterface(r,a,{compareTo:null});var t=function(){};t.__typeName="ss.IEquatable";a.IEquatable=t;a.initInterface(t,a,{equalsT:null});a.formatNumber=function(c,b){return a.isNullOrUndefined(b)||b.length==0||b=="i"?c.toString():a.netFormatNumber(c,b,h.invariantCulture.numberFormat)};a.localeFormatNumber=function(c,b){return a.isNullOrUndefined(b)||b.length==0||b=="i"?c.toLocaleString():a.netFormatNumber(c,b,h.currentCulture.numberFormat)};a._commaFormatNumber=function(b,k,o,p){var d=null,i=b.indexOf(o);if(i>0){d=b.substr(i);b=b.substr(0,i)}var j=a.startsWithString(b,"-");if(j)b=b.substr(1);var g=0,h=k[g];if(b.length1)d=parseInt(i.substr(1));var g=i.charAt(0);switch(g){case"d":case"D":b=parseInt(Math.abs(e)).toString();if(d!=-1)b=a.padLeftString(b,d,48);if(e<0)b="-"+b;break;case"x":case"X":b=parseInt(Math.abs(e)).toString(16);if(g=="X")b=b.toUpperCase();if(d!=-1)b=a.padLeftString(b,d,48);break;case"e":case"E":if(d==-1)b=e.toExponential();else b=e.toExponential(d);if(g=="E")b=b.toUpperCase();break;case"f":case"F":case"n":case"N":if(d==-1)d=c.numberDecimalDigits;b=e.toFixed(d).toString();if(d&&c.numberDecimalSeparator!="."){var f=b.indexOf(".");b=b.substr(0,f)+c.numberDecimalSeparator+b.substr(f+1)}if(g=="n"||g=="N")b=a._commaFormatNumber(b,c.numberGroupSizes,c.numberDecimalSeparator,c.numberGroupSeparator);break;case"c":case"C":if(d==-1)d=c.currencyDecimalDigits;b=Math.abs(e).toFixed(d).toString();if(d&&c.currencyDecimalSeparator!="."){var f=b.indexOf(".");b=b.substr(0,f)+c.currencyDecimalSeparator+b.substr(f+1)}b=a._commaFormatNumber(b,c.currencyGroupSizes,c.currencyDecimalSeparator,c.currencyGroupSeparator);if(e<0)b=a.formatString(c.currencyNegativePattern,b);else b=a.formatString(c.currencyPositivePattern,b);break;case"p":case"P":if(d==-1)d=c.percentDecimalDigits;b=(Math.abs(e)*100).toFixed(d).toString();if(d&&c.percentDecimalSeparator!="."){var f=b.indexOf(".");b=b.substr(0,f)+c.percentDecimalSeparator+b.substr(f+1)}b=a._commaFormatNumber(b,c.percentGroupSizes,c.percentDecimalSeparator,c.percentGroupSeparator);if(e<0)b=a.formatString(c.percentNegativePattern,b);else b=a.formatString(c.percentPositivePattern,b)}return b};a.netSplit=function(d,h,i,f){for(var g=new RegExp(h.map(a.regexpEscape).join("|"),"g"),b=[],e,c=0;true;c=g.lastIndex)if(e=g.exec(d)){if(f!==1||e.index>c)if(b.length===i-1){b.push(d.substr(c));return b}else b.push(d.substring(c,e.index))}else{(f!==1||c!==d.length)&&b.push(d.substr(c));return b}};a.compareStrings=function(a,b,c){if(c){if(a)a=a.toUpperCase();if(b)b=b.toUpperCase()}a=a||"";b=b||"";return a==b?0:ab.length?false:b.substr(b.length-a.length)==a};a._formatString=function(c,d,b){if(!a._formatRE)a._formatRE=/\{\{|\}\}|\{[^\}\{]+\}/g;return c.replace(a._formatRE,function(c){if(c==="{{"||c==="}}")return c.charAt(0);var h=parseInt(c.substr(1)),e=d[h+1];if(a.isNullOrUndefined(e))return"";if(a.isInstanceOfType(e,z)){var g=null,f=c.indexOf(":");if(f>0)g=c.substring(f+1,c.length-1);return a.format(e,g)}else return b?e.toLocaleString():e.toString()})};a.formatString=function(b){return a._formatString(b,arguments,false)};a.stringFromChar=function(a,d){for(var c=a,b=1;b";default:return"&"+a+";"}})};a.htmlEncode=function(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")};a.jsEncode=function(a,b){a=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"');return b?'"'+a+'"':a};a.indexOfAnyString=function(g,e,a,f){var b=g.length;if(!b)return-1;e=String.fromCharCode.apply(null,e);a=a||0;f=f||b;var d=a+f-1;if(d>=b)d=b-1;for(var c=a;c<=d;c++)if(e.indexOf(g.charAt(c))>=0)return c;return-1};a.insertString=function(a,b,c){if(!c)return a;if(!b)return c+a;var d=a.substr(0,b),e=a.substr(b);return d+c+e};a.isNullOrEmptyString=function(a){return!a||!a.length};a.lastIndexOfAnyString=function(g,e,a,f){var d=g.length;if(!d)return-1;e=String.fromCharCode.apply(null,e);a=a||d-1;f=f||d;var c=a-f+1;if(c<0)c=0;for(var b=a;b>=c;b--)if(e.indexOf(g.charAt(b))>=0)return b;return-1};a.localeFormatString=function(b){return a._formatString(b,arguments,true)};a.padLeftString=function(b,d,c){if(b.lengththis.length?c.substr(0,a):c.substr(0,a)+c.substr(a+b)};a.replaceAllString=function(c,b,a){a=a||"";return c.split(b).join(a)};a.startsWithString=function(b,a){return!a.length?true:a.length>b.length?false:b.substr(0,a.length)==a};if(!String.prototype.trim)String.prototype.trim=function(){return a.trimStartString(a.trimEndString(this))};a.trimEndString=function(b,a){return b.replace(a?new RegExp("["+String.fromCharCode.apply(null,a)+"]+$"):/\s*$/,"")};a.trimStartString=function(b,a){return b.replace(a?new RegExp("^["+String.fromCharCode.apply(null,a)+"]+"):/^\s*/,"")};a.trimString=function(c,b){return a.trimStartString(a.trimEndString(c,b),b)};a.lastIndexOfString=function(e,c,a,d){var b=e.lastIndexOf(c,a);return b0|-(a<0);if(a%1===.5*b){var d=Math.floor(a);return(d+(e?b>0:d%2*b))/c}return Math.round(a)/c};var y=function(){};y.__typeName="ss.IFormatProvider";a.IFormatProvider=y;a.initInterface(y,a,{getFormat:null});var n=function(){};n.__typeName="ss.NumberFormatInfo";a.NumberFormatInfo=n;a.initClass(n,a,{getFormat:function(a){return a===n?this:null}},null,[y]);n.invariantInfo=new n;a.shallowCopy({naNSymbol:"NaN",negativeSign:"-",positiveSign:"+",negativeInfinitySymbol:"-Infinity",positiveInfinitySymbol:"Infinity",percentSymbol:"%",percentGroupSizes:[3],percentDecimalDigits:2,percentDecimalSeparator:".",percentGroupSeparator:",",percentPositivePattern:0,percentNegativePattern:0,currencySymbol:"$",currencyGroupSizes:[3],currencyDecimalDigits:2,currencyDecimalSeparator:".",currencyGroupSeparator:",",currencyNegativePattern:0,currencyPositivePattern:0,numberGroupSizes:[3],numberDecimalDigits:2,numberDecimalSeparator:".",numberGroupSeparator:","},n.invariantInfo);var m=function(){};m.__typeName="ss.DateTimeFormatInfo";a.DateTimeFormatInfo=m;a.initClass(m,a,{getFormat:function(a){return a===m?this:null}},null,[y]);m.invariantInfo=new m;a.shallowCopy({amDesignator:"AM",pmDesignator:"PM",dateSeparator:"/",timeSeparator:":",gmtDateTimePattern:"ddd, dd MMM yyyy HH:mm:ss 'GMT'",universalDateTimePattern:"yyyy-MM-dd HH:mm:ssZ",sortableDateTimePattern:"yyyy-MM-ddTHH:mm:ss",dateTimePattern:"dddd, MMMM dd, yyyy h:mm:ss tt",longDatePattern:"dddd, MMMM dd, yyyy",shortDatePattern:"M/d/yyyy",longTimePattern:"h:mm:ss tt",shortTimePattern:"h:mm tt",firstDayOfWeek:0,dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],minimizedDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},m.invariantInfo);var f=function(){this._stopTime=0;this._startTime=0;this.isRunning=false};f.startNew=function(){var a=new f;a.start();return a};if(typeof window!=="undefined"&&window.performance&&window.performance.now){f.frequency=1e6;f.isHighResolution=true;f.getTimestamp=function(){return Math.round(window.performance.now()*1e3)}}else if(typeof process!=="undefined"&&process.hrtime){f.frequency=1e9;f.isHighResolution=true;f.getTimestamp=function(){var a=process.hrtime();return a[0]*1e9+a[1]}}else{f.frequency=1e3;f.isHighResolution=false;f.getTimestamp=function(){return(new Date).valueOf()}}f.__typeName="ss.Stopwatch";a.Stopwatch=f;a.initClass(f,a,{reset:function(){this._stopTime=this._startTime=f.getTimestamp();this.isRunning=false},ticks:function(){return(this.isRunning?f.getTimestamp():this._stopTime)-this._startTime},milliseconds:function(){return Math.round(this.ticks()/f.frequency*1e3)},timeSpan:function(){return new u(this.milliseconds()*1e4)},start:function(){if(this.isRunning)return;this._startTime=f.getTimestamp();this.isRunning=true},stop:function(){if(!this.isRunning)return;this._stopTime=f.getTimestamp();this.isRunning=false},restart:function(){this.isRunning=false;this.start()}});a._flatIndex=function(a,c){if(c.length!=(a._sizes?a._sizes.length:1))throw new e("Invalid number of indices");if(c[0]<0||c[0]>=(a._sizes?a._sizes[0]:a.length))throw new e("Index 0 out of range");var d=c[0];if(a._sizes)for(var b=1;b=a._sizes[b])throw new e("Index "+b+" out of range");d=d*a._sizes[b]+c[b]}return d};a.arrayGet2=function(b,d){var e=a._flatIndex(b,d),c=b[e];return typeof c!=="undefined"?c:b._defvalue};a.arrayGet=function(b){return a.arrayGet2(b,Array.prototype.slice.call(arguments,1))};a.arraySet2=function(b,d,c){var e=a._flatIndex(b,c);b[e]=d};a.arraySet=function(){return a.arraySet2(arguments[0],arguments[arguments.length-1],Array.prototype.slice.call(arguments,1,arguments.length-1))};a.arrayRank=function(a){return a._sizes?a._sizes.length:1};a.arrayLength=function(a,b){if(b>=(a._sizes?a._sizes.length:1))throw new e("Invalid dimension");return a._sizes?a._sizes[b]:a.length};a.arrayExtract=function(d,b,c){return!a.isValue(c)?d.slice(b):d.slice(b,b+c)};a.arrayAddRange=function(d,c){if(c instanceof Array)d.push.apply(d,c);else{var b=a.getEnumerator(c);try{while(b.moveNext())a.add(d,b.current())}finally{a.isInstanceOfType(b,i)&&a.cast(b,i).dispose()}}};a.arrayClone=function(a){return a.length===1?[a[0]]:Array.apply(null,a)};a.arrayPeekFront=function(a){if(a.length)return a[0];throw new g("Array is empty");};a.arrayPeekBack=function(a){if(a.length)return a[a.length-1];throw new g("Array is empty");};a.indexOfArray=function(d,e,c){c=c||0;for(var b=c;b=0?"-":"+")+Math.floor(Math.abs(b));break;case"zz":case"zzz":b=c.getTimezoneOffset()/60;b=(b>=0?"-":"+")+Math.floor(a.padLeftString(Math.abs(b)).toString(),2,48);if(f=="zzz")b+=d.timeSeparator+Math.abs(a.padLeftString(c.getTimezoneOffset()%60).toString(),2,48);break;default:if(b.charAt(0)=="'")b=b.substr(1,b.length-2).replace(/\\'/g,"'")}j.append(b)}return j.toString()};a._parseExactDate=function(c,j,p,u){p=p&&p.getFormat(m)||h.currentCulture.dateTimeFormat;var q=p.amDesignator,r=p.pmDesignator,t=function(b){for(var c="1234567890",a=0;a=c;b--){var a=f.substring(d,d+b);if(a.length30)e=1900+(e-0);else e=2e3+(e-0)}else if(a=="MM"||a=="M"){f=i(c,b,a.length,2);if(f==null||f<1||f>12)return null;b+=f.length}else if(a=="dd"||a=="d"){g=i(c,b,a.length,2);if(g==null||g<1||g>31)return null;b+=g.length}else if(a=="hh"||a=="h"){d=i(c,b,a.length,2);if(d==null||d<1||d>12)return null;b+=d.length}else if(a=="HH"||a=="H"){d=i(c,b,a.length,2);if(d==null||d<0||d>23)return null;b+=d.length}else if(a=="mm"||a=="m"){l=i(c,b,a.length,2);if(l==null||l<0||l>59)return null;b+=l.length}else if(a=="ss"||a=="s"){k=i(c,b,a.length,2);if(k==null||k<0||k>59)return null;b+=k.length}else if(a=="t"){if(c.substring(b,b+1).toLowerCase()==q.charAt(0).toLowerCase())n=q;else if(c.substring(b,b+1).toLowerCase()==r.charAt(0).toLowerCase())n=r;else return null;b+=1}else if(a=="tt"){if(c.substring(b,b+2).toLowerCase()==q.toLowerCase())n=q;else if(c.substring(b,b+2).toLowerCase()==r.toLowerCase())n=r;else return null;b+=2}else if(c.substring(b,b+a.length)!=a)return null;else b+=a.length}if(b!=c.length)return null;if(f==2)if(e%4==0&&e%100!=0||e%400==0){if(g>29)return null}else if(g>28)return null;if(f==4||f==6||f==9||f==11)if(g>30)return null;if(d<12&&n==r)d=d-0+12;else if(d>11&&n==q)d-=12;return u?new Date(Date.UTC(e,f-1,g,d,l,k)):new Date(e,f-1,g,d,l,k)};a.parseExactDate=function(d,c,b){return a._parseExactDate(d,c,b,false)};a.parseExactDateUTC=function(d,c,b){return a._parseExactDate(d,c,b,true)};a._delegateContains=function(b,d,c){for(var a=0;a=0;d--){var l=i[d].trim(),h=false;for(var c in b)if(c===l){j|=b[c];h=true;break}if(!h){g=false;break}}if(g)return j}throw new e("Invalid Enumeration Value");};C.toString=function(g,f){var b=g.prototype;if(!a.isFlags(g)||f===0){for(var c in b)if(b[c]===f)return c;throw new e("Invalid Enumeration Value");}else{var d=[];for(var c in b)b[c]&f&&a.add(d,c);if(!d.length)throw new e("Invalid Enumeration Value");return d.join(" | ")}};C.getValues=function(d){var b=[],a=d.prototype;for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b};var h=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};h.__typeName="ss.CultureInfo";a.CultureInfo=h;a.initClass(h,a,{getFormat:function(a){switch(a){case n:return this.numberFormat;case m:return this.dateTimeFormat;default:return null}}},null,[y]);h.invariantCulture=new h("en-US",n.invariantInfo,m.invariantInfo);h.currentCulture=h.invariantCulture;var B=function(){};B.__typeName="ss.IEnumerator";a.IEnumerator=B;a.initInterface(B,a,{current:null,moveNext:null,reset:null},[i]);var s=function(){};s.__typeName="ss.IEnumerable";a.IEnumerable=s;a.initInterface(s,a,{getEnumerator:null});a.getEnumerator=function(a){return a.getEnumerator?a.getEnumerator():new T(a)};var A=function(){};A.__typeName="ss.ICollection";a.ICollection=A;a.initInterface(A,a,{get_count:null,add:null,clear:null,contains:null,remove:null});a.count=function(a){return a.get_count?a.get_count():a.length};a.add=function(b,c){if(b.add)b.add(c);else if(a.isArray(b))b.push(c);else throw new q;};a.clear=function(b){if(b.clear)b.clear();else if(a.isArray(b))b.length=0;else throw new q;};a.remove=function(b,d){if(b.remove)return b.remove(d);else if(a.isArray(b)){var c=a.indexOf(b,d);if(c>=0){b.splice(c,1);return true}return false}else throw new q;};a.contains=function(b,c){return b.contains?b.contains(c):a.indexOf(b,c)>=0};var u=function(a){this.ticks=a||0};u.getDefaultValue=u.createInstance=function(){return new u(0)};u.__typeName="ss.TimeSpan";a.TimeSpan=u;a.initClass(u,a,{compareTo:function(a){return this.ticksa.ticks?1:0},equals:function(b){return a.isInstanceOfType(b,u)&&b.ticks===this.ticks},equalsT:function(a){return a.ticks===this.ticks},toString:function(){var d=function(c,b){return a.padLeftString(c+"",b||2,48)},b=this.ticks,c="";if(Math.abs(b)>=8.64e11){c+=d(b/8.64e11|0)+".";b%=8.64e11}c+=d(b/3.6e10|0)+":";b%=3.6e10;c+=d(b/6e8|0)+":";b%=6e8;c+=d(b/1e7|0);b%=1e7;if(b>0)c+="."+d(b,7);return c}},null,[r,t]);u.__class=false;var Q=function(){};Q.__typeName="ss.IEqualityComparer";a.IEqualityComparer=Q;a.initInterface(Q,a,{areEqual:null,getObjectHashCode:null});var X=function(){};X.__typeName="ss.IComparer";a.IComparer=X;a.initInterface(X,a,{compare:null});a.unbox=function(b){if(!a.isValue(b))throw new g("Nullable object must have a value.");return b};var c=function(d){var b=function(){};b.isInstanceOfType=function(b){return a.isInstanceOfType(b,d)};a.registerGenericClassInstance(b,c,[d],{},function(){return null},function(){return[]});return b};c.__typeName="ss.Nullable$1";a.Nullable$1=c;a.initGenericClass(c,a,1);c.eq=function(b,c){return!a.isValue(b)?!a.isValue(c):b===c};c.ne=function(b,c){return!a.isValue(b)?a.isValue(c):b!==c};c.le=function(b,c){return a.isValue(b)&&a.isValue(c)&&b<=c};c.ge=function(b,c){return a.isValue(b)&&a.isValue(c)&&b>=c};c.lt=function(b,c){return a.isValue(b)&&a.isValue(c)&&bc};c.sub=function(b,c){return a.isValue(b)&&a.isValue(c)?b-c:null};c.add=function(b,c){return a.isValue(b)&&a.isValue(c)?b+c:null};c.mod=function(b,c){return a.isValue(b)&&a.isValue(c)?b%c:null};c.div=function(b,c){return a.isValue(b)&&a.isValue(c)?b/c:null};c.mul=function(b,c){return a.isValue(b)&&a.isValue(c)?b*c:null};c.band=function(b,c){return a.isValue(b)&&a.isValue(c)?b&c:null};c.bor=function(b,c){return a.isValue(b)&&a.isValue(c)?b|c:null};c.xor=function(b,c){return a.isValue(b)&&a.isValue(c)?b^c:null};c.shl=function(b,c){return a.isValue(b)&&a.isValue(c)?b<>c:null};c.sru=function(b,c){return a.isValue(b)&&a.isValue(c)?b>>>c:null};c.and=function(a,b){return a===true&&b===true?true:a===false||b===false?false:null};c.or=function(a,b){return a===true||b===true?true:a===false&&b===false?false:null};c.not=function(b){return a.isValue(b)?!b:null};c.neg=function(b){return a.isValue(b)?-b:null};c.pos=function(b){return a.isValue(b)?+b:null};c.cpl=function(b){return a.isValue(b)?~b:null};c.lift=function(){for(var b=0;bd)return false;b.$=a;return true};var H=function(){};H.__typeName="ss.JsDate";a.JsDate=H;a.initClass(H,a,{},Object,[t,r]);H.createInstance=function(){return new Date};H.isInstanceOfType=function(a){return a instanceof Date};var T=function(a){this._array=a;this._index=-1};T.__typeName="ss.ArrayEnumerator";a.ArrayEnumerator=T;a.initClass(T,a,{moveNext:function(){this._index++;return this._index=this._array.length)throw"Invalid operation";return this._array[this._index]},dispose:function(){}},null,[B,i]);var cb=function(a){this._keys=Object.keys(a);this._index=-1;this._object=a};cb.__typeName="ss.ObjectEnumerator";a.ObjectEnumerator=cb;a.initClass(cb,a,{moveNext:function(){this._index++;return this._index=this._keys.length)throw new g("Invalid operation");var a=this._keys[this._index];return{key:a,value:this._object[a]}},dispose:function(){}},null,[B,i]);var x=function(){};x.__typeName="ss.EqualityComparer";a.EqualityComparer=x;a.initClass(x,a,{areEqual:function(b,c){return a.staticEquals(b,c)},getObjectHashCode:function(b){return a.isValue(b)?a.getHashCode(b):0}},null,[Q]);x.def=new x;var G=function(a){this.f=a};G.__typeName="ss.Comparer";a.Comparer=G;a.initClass(G,a,{compare:function(a,b){return this.f(a,b)}},null,[X]);G.def=new G(function(c,b){return!a.isValue(c)?!a.isValue(b)?0:-1:!a.isValue(b)?1:a.compare(c,b)});var E=function(b,a){this._dict=b;this._isKeys=a},W=function(d,b){var c=function(b,g){this.countField=0;this.buckets={};this.comparer=g||x.def;if(a.isInstanceOfType(b,F)){var c=a.getEnumerator(b);try{while(c.moveNext()){var f=c.current();this.add(f.key,f.value)}}finally{a.isInstanceOfType(c,i)&&a.cast(c,i).dispose()}}else if(b)for(var e=Object.keys(b),d=0;d=this.buckets[c[a]].length-1){b=-1;a++}if(a>=c.length)return false;b++;return true},function(){return d(this.buckets[c[a]][b])},null,this)},get_keys:function(){return new E(this,true)},get_values:function(){return new E(this,false)},getEnumerator:function(){return this._getEnumerator(function(a){return a})}},function(){return null},function(){return[F,s]});return c};W.__typeName="ss.Dictionary$2";a.Dictionary$2=W;a.initGenericClass(W,a,2);E.__typeName="ss.$DictionaryCollection";a.$DictionaryCollection=E;a.initClass(E,a,{get_count:function(){return this._dict.get_count()},contains:function(d){if(this._isKeys)return this._dict.containsKey(d);else{for(var c in this._dict.buckets)if(this._dict.buckets.hasOwnProperty(c))for(var b=this._dict.buckets[c],a=0;a=56)this.inext=1;if(++this.inextp>=56)this.inextp=1;var a=this.seedArray[this.inext]-this.seedArray[this.inextp];if(a<0)a+=2147483648;this.seedArray[this.inext]=a;return a*(1/2147483648)}});var w=function(){};w.__typeName="ss.EventArgs";a.EventArgs=w;a.initClass(w,a,{});w.Empty=new w;var b=function(b,a){this._message=b||"An error occurred.";this._innerException=a||null};b.__typeName="ss.Exception";a.Exception=b;a.initClass(b,a,{get_message:function(){return this._message},get_innerException:function(){return this._innerException}});b.wrap=function(c){return a.isInstanceOfType(c,b)?c:c instanceof TypeError?new p(c.message):c instanceof RangeError?new J(null,c.message):c instanceof Error?new R(c):new b(c.toString())};var bb=function(c,a){b.call(this,c||"The method or operation is not implemented.",a)};bb.__typeName="ss.NotImplementedException";a.NotImplementedException=bb;a.initClass(bb,a,{},b);var q=function(c,a){b.call(this,c||"Specified method is not supported.",a)};q.__typeName="ss.NotSupportedException";a.NotSupportedException=q;a.initClass(q,a,{},b);var v=function(d,c){this.innerExceptions=a.isValue(c)?a.arrayFromEnumerable(c):[];b.call(this,d||"One or more errors occurred.",this.innerExceptions.length?this.innerExceptions[0]:null)};v.__typeName="ss.AggregateException";a.AggregateException=v;a.initClass(v,a,{flatten:function(){for(var b=[],d=0;d0)c.setException(d);else if(f)c.setCanceled();else c.setResult(h)})})(e);return c.task};j.whenAny=function(b){if(!b.length)throw new e("Must wait for at least one task","tasks");for(var a=new l,c=0;c=0?a:arguments.length+a]}}(a);else if(typeof a!=="function")a=function(){return Array.prototype.slice.call(arguments,0)};c.then(function(){b.setResult(typeof a==="function"?a.apply(null,arguments):null)},function(){b.setException(new S(Array.prototype.slice.call(arguments,0)))});return b.task};j.fromNode=function(f,c,e){var d=new l,a;if(typeof c==="function")a=Array.prototype.slice.call(arguments,3);else{a=Array.prototype.slice.call(arguments,2);e=c;c=function(){return arguments[0]}}var g=function(a){if(a)d.setException(b.wrap(a));else d.setResult(c.apply(null,Array.prototype.slice.call(arguments,1)))};a.push(g);f[e].apply(f,a);return d.task};j.__typeName="ss.Task";a.Task=j;a.initClass(j,a,{continueWith:function(d){var a=new l,e=this,c=function(){try{a.setResult(d(e))}catch(c){a.setException(b.wrap(c))}};if(this.isCompleted())setTimeout(c,0);else this._thens.push(c);return a.task},start:function(){if(this.status!==0)throw new g("Task was already started.");var a=this;this.status=3;setTimeout(function(){try{var c=a._action(a._state);delete a._action;delete a._state;a._complete(c)}catch(d){a._fail(new v(null,[b.wrap(d)]))}},0)},_runCallbacks:function(){for(var a=0;a=5},isFaulted:function(){return this.status===7},_getResult:function(a){switch(this.status){case 5:return this._result;case 6:throw new g("Task was cancelled.");case 7:throw a?this.exception.innerExceptions[0]:this.exception;default:throw new g("Task is not yet completed.");}},getResult:function(){return this._getResult(false)},getAwaitedResult:function(){return this._getResult(true)},dispose:function(){}},null,[i]);var eb=function(){};eb.__typeName="ss.TaskStatus";a.TaskStatus=eb;a.initEnum(eb,a,{created:0,running:3,ranToCompletion:5,canceled:6,faulted:7});var l=function(){this.task=new j;this.task.status=3};l.__typeName="ss.TaskCompletionSource";a.TaskCompletionSource=l;a.initClass(l,a,{setCanceled:function(){if(!this.task._cancel())throw new g("Task was already completed.");},setResult:function(a){if(!this.task._complete(a))throw new g("Task was already completed.");},setException:function(a){if(!this.trySetException(a))throw new g("Task was already completed.");},trySetCanceled:function(){return this.task._cancel()},trySetResult:function(a){return this.task._complete(a)},trySetException:function(c){if(a.isInstanceOfType(c,b))c=[c];return this.task._fail(new v(null,c))}});var db=function(){w.call(this);this.cancel=false};db.__typeName="ss.CancelEventArgs";a.CancelEventArgs=db;a.initClass(db,a,{},w);var d=function(){};d.$valid=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ig;d.$split=/^(.{8})(.{4})(.{4})(.{4})(.{12})$/;d.empty="00000000-0000-0000-0000-000000000000";d.$rng=new Y;d.__typeName="ss.Guid";a.Guid=d;a.initClass(d,a,{},Object,[t,r]);d.__class=false;d.isInstanceOfType=function(a){return typeof a==="string"&&a.match(d.$valid)};d.getDefaultValue=d.createInstance=function(){return d.empty};d.parse=function(c,b){var a={};if(d.tryParse(c,b,a))return a.$;throw new U("Unable to parse UUID");};d.tryParse=function(b,c,f){f.$=d.empty;if(!a.isValue(b))throw new M("uuid");if(!c){var e=/^[{(]?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})[)}]?$/ig.exec(b);if(e){f.$=e.slice(1).join("-").toLowerCase();return true}}else{if(c==="N"){var e=d.$split.exec(b);if(!e)return false;b=e.slice(1).join("-")}else if(c==="B"||c==="P"){var g=c==="B";if(b[0]!==(g?"{":"(")||b[b.length-1]!==(g?"}":")"))return false;b=b.substr(1,b.length-2)}if(b.match(d.$valid)){f.$=b.toLowerCase();return true}}return false};d.format=function(a,b){switch(b){case"N":return a.replace(/-/g,"");case"B":return"{"+a+"}";case"P":return"("+a+")";default:return a}};d.fromBytes=function(b){if(!b||b.length!==16)throw new e("b","Must be 16 bytes");var c=b.map(function(b){return a.formatNumber(b&255,"x2")}).join("");return d.$split.exec(c).slice(1).join("-")};d.newGuid=function(){var a=Array(16);d.$rng.nextBytes(a);a[6]=a[6]&15|64;a[8]=a[8]&191|128;return d.fromBytes(a)};d.getBytes=function(c){for(var b=Array(16),d=c.replace(/-/g,""),a=0;a<16;a++)b[a]=parseInt(d.substr(a*2,2),16);return b};if(k.ss){for(var gb in a)if(a.hasOwnProperty(gb))k.ss[gb]=a[gb]}else k.ss=a})(global)
\ No newline at end of file
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.dll b/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.dll
deleted file mode 100644
index 16bfd9c..0000000
Binary files a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.dll and /dev/null differ
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.xml b/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.xml
deleted file mode 100644
index 2a9b40d..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/Assemblies/mscorlib.xml
+++ /dev/null
@@ -1,2519 +0,0 @@
-
-
-
- mscorlib
-
-
-
-
- Equivalent to the Object type in Javascript.
-
-
-
-
- Retrieves the type associated with an object instance.
-
- The type of the object.
-
-
-
- Converts an object to its string representation.
-
- The string representation of the object.
-
-
-
- Converts an object to its culture-sensitive string representation.
-
- The culture-sensitive string representation of the object.
-
-
-
- Returns an array of a given object's own enumerable properties, in the same order as that provided by a for-in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
-
- Object to investigate
-
-
-
- Returns an array of all properties (enumerable or not) found directly upon a given object.
-
- Object to investigate
-
-
- Specifies the application elements on which it is valid to apply an attribute.
-
-
- Specifies the usage of another attribute class. This class cannot be inherited.
-
-
- Initializes a new instance of the class with the specified list of , the value, and the value.
- The set of values combined using a bitwise OR operation to indicate which program elements are valid.
-
-
- Gets a set of values identifying which program elements that the indicated attribute can be applied to.
- One or several values. The default is All.
-
-
- Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element.
- true if more than one instance is allowed to be specified; otherwise, false. The default is false.
-
-
- Gets or sets a Boolean value indicating whether the indicated attribute can be inherited by derived classes and overriding members.
- true if the attribute can be inherited by derived classes and overriding members; otherwise, false. The default is true.
-
-
- Provides a base class for implementations of the generic interface.
- The type of objects to compare.
-
-
- When overridden in a derived class, performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
- A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than .
- The first object to compare.The second object to compare.
-
-
- Returns a default sort order comparer for the type specified by the generic argument.
- An object that inherits and serves as a sort order comparer for type .
-
-
- Defines a method that a type implements to compare two objects.
- The type of objects to compare.This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
-
-
- Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
- A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than zero is less than .Zero equals .Greater than zero is greater than .
- The first object to compare.
- The second object to compare.
-
-
-
- Don't use. Use instead.
-
-
-
-
- Don't use. Use instead. When implementing , just provide a dummy implementation for this method.
-
-
-
-
- Don't use. Use instead. When implementing , just provide a dummy implementation for this method.
-
-
-
-
- Don't use this interface, use the generic one instead. When implementing, you need not supply a valid implementation of GetEnumerator.
-
-
-
-
- Don't call this method, use the generic version instead.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- This method will return a delegate that (when called) will call another delegate, with the JavaScript 'this' passed as the first parameter, and 'this' being as expected by the C# code. This is useful when dealing with jQuery.
-
-
-
-
- The JsDictionary data type which is mapped to the Object type in Javascript.
-
-
-
-
- Equivalent to the Array type in Javascript.
-
-
-
-
- Don't use this interface, use the generic one instead. When implementing, you need not supply a valid implementation of GetEnumerator.
-
-
-
-
- Don't call this method, use the generic version instead.
-
-
-
-
- Don't call this method, use the generic version instead.
-
-
-
-
- Don't call this method, use the generic version instead.
-
-
-
-
- The Queue data type which is mapped to the Array type in Javascript.
-
-
-
-
- The Stack data type which is mapped to the Array type in Javascript.
-
-
-
-
- The JsDictionary data type which is mapped to the Object type in Javascript.
-
-
-
-
- Initializes a new instance of the class that is a read-only wrapper around the specified list.
-
- The list to wrap.
-
-
-
- Determines whether an element is in the .
-
-
- true if is found in the ; otherwise, false.
-
- The object to locate in the . The value can be null for reference types.
-
-
-
- Returns an enumerator that iterates through the .
-
-
- An for the .
-
-
-
-
- Searches for the specified object and returns the zero-based index of the first occurrence within the entire .
-
-
- The zero-based index of the first occurrence of within the entire , if found; otherwise, -1.
-
- The object to locate in the . The value can be null for reference types.
-
-
-
- Gets the number of elements contained in the instance.
-
-
- The number of elements contained in the instance.
-
-
-
-
- Gets the element at the specified index.
-
-
- The element at the specified index.
-
- The zero-based index of the element to get.
-
-
-
- The Queue data type which is mapped to the Array type in Javascript.
-
-
-
-
- The Stack data type which is mapped to the Array type in Javascript.
-
-
-
-
- The ArrayBuffer type describes a buffer used to store data for the array buffer views.
-
-
-
-
- Returns a new ArrayBuffer whose contents are a copy of this
- ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.
- If either begin or end is negative, it refers to an index from the
- end of the array, as opposed to from the beginning.
-
-
-
-
- Returns a new ArrayBuffer whose contents are a copy of this
- ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.
- If either begin or end is negative, it refers to an index from the
- end of the array, as opposed to from the beginning.
-
-
-
-
- The length of the ArrayBuffer in bytes, as fixed at construction time.
-
-
-
-
- The ArrayBufferView type holds information shared among
- all of the types of views of ArrayBuffers.
-
-
-
-
- The ArrayBuffer that this ArrayBufferView references.
-
-
-
-
- The offset of this ArrayBufferView from the start of
- its ArrayBuffer, in bytes, as fixed at construction time.
-
-
-
-
- The length of the ArrayBufferView in bytes, as fixed at construction time.
-
-
-
-
- Represents a method that converts an object from one type to another type.
-
-
- The that represents the converted .
-
- The object to convert.The type of object that is to be converted.This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.The type the input object is to be converted to.This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.1
-
-
- Represents the method that compares two objects of the same type.
- A signed integer that indicates the relative values of and , as shown in the following table.Value Meaning Less than 0 is less than .0 equals .Greater than 0 is greater than .
- The first object to compare.
- The second object to compare.
- The type of the objects to compare.This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
-
-
-
- This attribute supports the infrastructure and should not be applied manually.
-
-
-
-
- This attribute supports the infrastructure and should not be applied manually.
-
-
-
-
- The Guid data type which is mapped to the string type in Javascript.
-
-
-
-
- Compares the current object with another object of the same type.
-
-
- A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than .
-
- An object to compare with this object.
-
-
-
- Provides functionality to format the value of an object into a string representation.
-
-
-
- Formats the value of the current instance using the specified format.
- The value of the current instance in the specified format.
- The format to use.-or- A null reference to use the default format defined for the type of the implementation.
-
-
-
- Specifies the day of the week.
-
-
-
-
- Specifies flags that control binding and the way in which the search for members and types is conducted by reflection.
-
-
-
-
- Returns an array of all custom attributes applied to this member.
-
- Ignored for members. Base members will never be considered.
- An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
-
-
-
- Returns an array of custom attributes applied to this member and identified by .
-
- The type of attribute to search for. Only attributes that are assignable to this type are returned.
- Ignored for members. Base members will never be considered.
- An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
-
-
-
- Returns an array of all custom attributes applied to this member.
-
- An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
-
-
-
- Returns an array of custom attributes applied to this member and identified by .
-
- The type of attribute to search for. Only attributes that are assignable to this type are returned.
- An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.
-
-
-
- Script name of the constructor. Null for the unnamed constructor and for constructors with special implementations
-
-
-
-
- True if the constructor is a normal method that returns the created instance and should be invoked without the 'new' operator
-
-
-
-
- For constructors with a special implementation (eg. [ObjectLiteral] or [InlineCode]), contains a delegate that can be invoked to create an instance.
-
-
-
-
- Whether the [ExpandParams] attribute was specified on the constructor.
-
-
-
-
- For properties implemented as fields, contains the name of the field. Null for properties implemented as get and set methods.
-
-
-
-
- Script name of the field
-
-
-
-
- Marks each type of member that is defined as a derived class of MemberInfo.
-
-
-
-
- Script name of the method. Null if the method has a special implementation.
-
-
-
-
- If true, this method should be invoked as a static method with the 'this' reference as the first argument. Note that this property does not affect the Invoke and CreateDelegate methods.
-
-
-
-
- For methods with a special implementation (eg. [InlineCode]), contains a delegate that represents the method. Null for normal methods.
-
-
-
-
- Whether the [ExpandParams] attribute was specified on the method.
-
-
-
-
- This attribute indicates that a class is a serializable type, and can be used as an alternative to inheriting from . Record classes must inherit directly from object, be sealed, and cannot contain any instance events.
- Instance properties in serializable types are implemented as fields.
- All instance fields and properties on serializable types will act as they were decorated with a [PreserveNameAttribute], unless another renaming attribute was specified.
-
-
-
-
- Code used to check whether an object is of this type. Can use the placeholder {this} to reference the object being checked, as well as all type parameter for the type.
-
-
-
-
- Initializes a new instance of the class, using a time-dependent default seed value.
-
-
-
-
- Initializes a new instance of the class, using the specified seed value.
-
-
- A number used to calculate a starting value for the pseudo-random number sequence.
- If a negative number is specified, the absolute value of the number is used.
-
-
-
-
- Returns a nonnegative random number.
-
-
-
-
- Returns a nonnegative random number less than the specified maximum.
-
-
-
-
- Returns a random number within a specified range.
-
-
-
-
- Fills the elements of a specified array of bytes with random numbers.
-
-
-
-
- Returns a random number between 0.0 and 1.0.
-
-
-
-
-
- Returns a random number between 0.0 and 1.0.
-
-
-
-
- Represents a JavaScript Error. Useful primarily for interop, within C# code it will always be wrapped to an Exception when caught.
-
-
-
-
- Returns additional data associated with the error (equivalent to a property access in JS).
-
-
-
-
- Equivalent to the Date type in Javascript.
-
-
-
-
- Creates a new instance of Date initialized from the current time.
-
-
-
-
- Creates a new instance of Date initialized from the specified number of milliseconds.
-
- Milliseconds since January 1st, 1970.
-
-
-
- Creates a new instance of Date initialized from parsing the specified date.
-
-
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (0 through 11)
- The day of the month (1 through # of days in the specified month)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (0 through 11)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (0 through 11)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (0 through 11)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
- The seconds (0 through 59)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (0 through 11)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
- The seconds (0 through 59)
- The milliseconds (0 through 999)
-
-
-
- Returns the difference in milliseconds between two dates.
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Returns the current date and time.
-
-
-
-
- Returns the current date with the time part set to 00:00:00.
-
-
-
-
- This class represents a match returned by the method.
-
-
-
-
- This exception is used as the exception for a task created from a promise when the underlying promise fails.
-
-
-
-
- Arguments supplied to the promise onError() callback.
-
-
-
-
- Represents a CommonJS Promise/A object. All the handlers can receive 0 or more arguments.
-
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
-
- Target to invoke the method on.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done.
-
- Target to invoke the method on.
- Index of the callback parameter in the actual method invocation.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted at the position indicated by the parameter).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to have a single parameter, whose value will be used as the return value of the task.
-
- Target to invoke the method on.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done.
- The callback is expected to have a single parameter, whose value will be used as the return value of the task.
-
- Target to invoke the method on.
- Index of the callback parameter in the actual method invocation.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted at the position indicated by the parameter).
-
-
-
- Creates a task from a promise. The result of the promise is not accessible through the task. THe result of the task is the parameters passed to the onCompleted callback of the promise.
-
-
-
-
- Creates a task from a promise. The result of the task will be set to one of the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Index of the argument in the onCompleted callback of the promise that will become the result of the task. negative values count from the back, positive values count from the front.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from a promise. A factory method is used to create the result of the task based on the arguments to the onCompleted callback of the promise.
-
- The promise to create a task from.
- Factory method to create the result of the task from the arguments to the onCompleted callback.
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Creates a task from an invocation that will invoke a callback when it is done. The callback should be the last argument to the invoked method.
- The callback is expected to be a node-style callback, where the first argument is an Error object, or null if successful
-
- Target to invoke the method on.
- Factory method to create the result of the task from the arguments to the callback.
- Name of the method to invoke on the target.
- Arguments to the method, not including the callback (which will be inserted as the last argument to the actual call).
-
-
-
- Specifies how mathematical rounding methods should process a number that is midway between two numbers.
-
-
-
-
- This attribute marks a field, property, event or method as
- "browsable", i.e. present in the type descriptor associated with
- the type.
-
-
-
-
- This attribute can be placed on types in system script assemblies that should not
- be imported. It is only meant to be used within mscorlib.dll.
-
-
-
-
- This attribute can be placed on types that should not be emitted into generated
- script, as they represent existing script or native types. All members without another naming attribute are considered to use [PreserveName].
-
-
-
-
- Indicates that the type obeys the Saltarelle type system. If false (the default), the type is ignored in inheritance lists, casts to it is a no-op, and Object will be used if the type is used as a generic argument.
- The default is false. Requiring this to be set should be very uncommon.
-
-
-
-
- Code used to check whether an object is of this type. Can use the placeholder {this} to reference the object being checked, as well as all type parameter for the type.
-
-
-
-
- Marks an assembly as a script assembly that can be used with Script#.
- Additionally, each script must have a unique name that can be used as
- a dependency name.
- This name is also used to generate unique names for internal types defined
- within the assembly. The ScriptQualifier attribute can be used to provide a
- shorter name if needed.
-
-
-
-
- Provides a prefix to use when generating types internal to this assembly so that
- they can be unique within a given a script namespace.
- The specified prefix overrides the script name provided in the ScriptAssembly
- attribute.
-
-
-
-
- This attribute indicates that the namespace of type within a system assembly
- should be ignored at script generation time. It is useful for creating namespaces
- for the purpose of c# code that don't exist at runtime.
-
-
-
-
- Specifies the namespace that should be used in generated script. The script namespace
- is typically a short name, that is often shared across multiple assemblies.
- The developer is responsible for ensuring that public types across assemblies that share
- a script namespace are unique.
- For internal types, the ScriptQualifier attribute can be used to provide a short prefix
- to generate unique names.
-
-
-
-
- This attribute can be placed on a static class that only contains static string
- fields representing a set of resource strings.
-
-
-
-
- This attribute turns methods on a static class as global methods in the generated
- script. Note that the class must be static, and must contain only methods.
-
-
-
-
- This attribute marks an enumeration type within a system assembly as as a set of
- names. Rather than the specific value, the name of the enumeration field is
- used as a string.
-
-
-
-
- This attribute marks an enumeration type within a system assembly as as a set of
- numeric values. Rather than the enum field, the value of the enumeration field is
- used as a literal.
-
-
-
-
- This attribute allows defining an alternate method signature that is not generated
- into script, but can be used for defining overloads to enable optional parameter semantics
- for a method. It must be applied on a method defined as extern, since an alternate signature
- method does not contain an actual method body.
-
-
-
-
- This attribute denotes a C# property that manifests like a field in the generated
- JavaScript (i.e. is not accessed via get/set methods). This is really meant only
- for use when defining OM corresponding to native objects exposed to script.
-
-
-
-
- Allows specifying the name to use for a type or member in the generated script. Property and event accessors can use the placeholder {owner} to denote the name of their owning entity.
-
-
-
-
- This attribute allows suppressing the default behavior of converting
- member names to camel-cased equivalents in the generated JavaScript.
-
-
-
-
- This attribute allows suppressing the default behavior of converting
- member names of attached type to camel-cased equivalents in the generated JavaScript.
- When applied to an assembly, all types in the assembly are considered to have this
- attribute by default
-
-
-
- This attribute allows suppressing the default behavior of minimizing
- private type names and member names in the generated JavaScript.
-
-
-
-
- This attribute allows public symbols inside an assembly to be minimized, in addition to non-public ones, when generating release scripts.
-
-
-
-
- This attribute allows specifying a script name for an imported method.
- The method is interpreted as a global method. As a result it this attribute
- only applies to static methods.
-
-
-
-
- This attributes causes a method to not be invoked. The method must either be a static method with one argument (in case Foo.M(x) will become x), or an instance method with no arguments (in which x.M() will become x).
- Can also be applied to a constructor, in which case the constructor will not be called if used as an initializer (": base()" or ": this()").
-
-
-
-
- The method is implemented as inline code, eg Debugger.Break() => debugger. Can use the parameters {this} (for instance methods), as well as all typenames and argument names in braces (eg. {arg0}, {TArg0}).
- If a parameter name is preceeded by an @ sign, {@arg0}, that argument must be a literal string during invocation, and the supplied string will be inserted as an identifier into the script (eg '{this}.set_{@arg0}({arg1})' can transform the call 'c.F("MyProp", v)' to 'c.set_MyProp(v)'.
- If a parameter name is preceeded by an asterisk {*arg} that parameter must be a param array, and all invocations of the method must use the expanded invocation form. The entire array supplied for the parameter will be inserted into the call. Pretend that the parameter is a normal parameter, and commas will be inserted or omitted at the correct locations.
- The format string can also use identifiers starting with a dollar {$Namespace.Name} to construct type references. The name must be the fully qualified type name in this case.
-
-
-
-
- If set, a method with this name will be generated from the method source.
-
-
-
-
- This code is used when the method is invoked non-virtually (eg. in a base.Method() call).
-
-
-
-
- This code is used when the method, which should be a method with a param array parameter, is invoked in non-expanded form. Optional, but can be used to support non-expanded invocation of a method that has a {*param} placeholder in its code.
-
-
-
-
- This attribute specifies that a static method should be treated as an instance method on its first argument. This means that MyClass.Method(x, a, b) will be transformed to x.Method(a, b).
- If no other name-preserving attribute is used on the member, it will be treated as if it were decorated with a [PreserveNameAttribute].
- Useful for extension methods.
-
-
-
-
- This attribute specifies that a generic type or method should have script generated as if it was a non-generic one. Any uses of the type arguments inside the method (eg. typeof(T), or calling another generic method with T as a type argument) will cause runtime errors.
-
-
-
-
- This enum defines the possibilities for default values for generic argument handling in an assembly.
-
-
-
-
- Include generic arguments for all types that are not [Imported]
-
-
-
-
- Ignore generic arguments by default (this is the default)
-
-
-
-
- Require an for all generic types/methods, excepts those that are imported, which will default to ignore their generic arguments.
-
-
-
-
- This attribute indicates whether generic arguments for types and methods are included, but can always be overridden by specifying an on types or methods.
-
-
-
-
- This attribute indicates that a user-defined operator should be compiled as if it were builtin (eg. op_Addition(a, b) => a + b). It can only be used on non-conversion operator methods.
-
-
-
-
- This attribute can be applied to a method with a "params" parameter to make the param array be expanded in script (eg. given 'void F(int a, params int[] b)', the invocation 'F(1, 2, 3)' will be translated to 'F(1, [2, 3])' without this attribute, but 'F(1, 2, 3)' with this attribute.
- Methods with this attribute can only be invoked in the expanded form.
-
-
-
-
- Indicates that the Javascript 'this' should appear as the first argument to the delegate.
-
-
-
-
- If this attribute is applied to a constructor for a serializable type, it means that the constructor will not be called, but rather an object initializer will be created. Eg. 'new MyRecord(1, "X")' can become '{ a: 1, b: 'X' }'.
- All parameters must have a field or property with the same (case-insensitive) name, of the same type.
- This attribute is implicit on constructors of imported serializable types.
-
-
-
-
- This attribute can be specified on an assembly to specify additional compatibility options to help migrating from Script#.
-
-
-
-
- If true, code will not be generated for casts of type '(MyClass)someValue'. Code will still be generated for 'someValue is MyClass' and 'someValue as MyClass'.
-
-
-
-
- If true, code will not be generated to verify that a nullable value is not null before converting it to its underlying type.
-
-
-
-
- If a constructor for a value type takes an instance of this type as a parameter, any attribute applied to that constructor will instead be applied to the default (undeclarable) constructor.
-
-
-
-
- Specifies that a type is defined in a module, which should be imported by a require() call.
-
-
-
-
- When specified on an assembly, Javascript that adheres to the AMD pattern (require/define) will be generated.
-
-
-
-
- When specified on an assembly with an AsyncModule attribute, the module will require this additional dependency in its AMD declaration
-
-
-
-
- Can be applied to a GetEnumerator() method to indicate that that array-style enumeration should be used.
-
-
-
-
- Can be applied to a const field to indicate that the literal value of the constant should always be used instead of the symbolic field name.
-
-
-
-
- Can be applied to a member to indicate that metadata for the member should (or should not) be included in the compiled script. By default members are reflectable if they have at least one scriptable attribute. The default reflectability can be changed with the [].
-
-
-
-
- This enum defines the possibilities for default member reflectability.
-
-
-
-
- Members are not reflectable (unless they are decorated either with any script-usable attributes or a [ReflectableAttribute])
-
-
-
-
- Public and protected members are reflectable, private/internal members are only reflectable if are decorated either with any script-usable attributes or a [ReflectableAttribute].
- Members are reflectable even when their enclosing type is not publicly visible.
-
-
-
-
- Public, protected and internal members are reflectable, private members are only reflectable if are decorated either with any script-usable attributes or a [ReflectableAttribute].
-
-
-
-
- All members are reflectable by default (can be overridden with [Reflectable(false)]).
-
-
-
-
- This attribute can be applied to an assembly or a type to indicate whether members are reflectable by default.
-
-
-
-
- Can be applied to a constant field to ensure that it will never be inlined, even in minified scripts.
-
-
-
-
- Can be applied to a user-defined value type (struct) to instruct the compiler that it can be mutated and therefore needs to be copied whenever .net would create a copy of a value type.
-
-
-
-
- Can be applied to a (non-const) field or an automatically implemented property to specify custom code to create the value with which the member is being initialized. For events and properties, this attribute applies to the compiler-generated backing field.
-
-
-
- JS code to initialize the field. Can use the placeholder {value} to represent the value with which the member is being initialized (as well as all other placeholders from ). If null, the member will not be initialized.
-
-
-
- Can be specified on a method or a constructor to indicate that no code should be generated for the member, but it has no effect on any usage of the member.
-
-
-
-
- Can be specified on an automatically implemented event or property to denote the name of the backing field. The presense of this attribute will also cause the backing field to be initialized even if no code is generated for the accessors (eg. if they are [InlineCode]).
-
-
-
-
- Can be specified on an invokable entity with default arguments to specify that arguments from the specific number will not be output to the script if the default value was used. Note that any specified argument (including the default value) will prevent this from happening.
-
-
-
-
- A function that filters and serializes objects being serialized into JSON text.
- If the callback returns undefined, the member is not serialized. Otherwise the new
- value returned from the callback is serialized instead.
-
- The name of the member.
- The value of the member.
- The value to be serialized.
-
-
-
- A function that filters and transforms objects deserialized from JSON text.
- If the callback returns the same value, the member is left unmodified. If
- the callback returns null, the member is removed. Otherwise the new value
- returned from the callback is used instead.
-
- The name of the member.
- The value of the member.
- The transformed value.
-
-
-
- Parses the specified JSON text.
-
- The JSON text to be parsed.
- The deserialized object.
-
-
-
- Parses the specified JSON text.
-
- The JSON text to be parsed.
- The deserialized object.
-
-
-
- Parses the specified JSON text.
-
- The JSON text to be parsed.
- A callback to invoke on each value that is deserialized.
- The deserialized object.
-
-
-
- Parses the specified JSON text.
-
- The JSON text to be parsed.
- A callback to invoke on each value that is deserialized.
- The deserialized object.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- The specific members to serialize and their order.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- The specific members to serialize and their order.
- The number of spaces to use for indentation.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- The specific members to serialize and their order.
- The string to use for indentation.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- A callback to invoke for each value being serialized.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- A callback to invoke for each value being serialized.
- The number of spaces to use for indentation.
- The serialized value as JSON text.
-
-
-
- Serializes the specified object into JSON representation.
-
- The object to serialize.
- A callback to invoke for each value being serialized.
- The string to use for indentation.
- The serialized value as JSON text.
-
-
-
- Equivalent to the Array type in Javascript.
-
-
-
-
- Equivalent to the Boolean type in Javascript.
-
-
-
-
- The byte data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The event argument associated with cancelable events.
-
-
-
-
- Used by event sources to pass event argument information.
-
-
-
-
- A static object of type that is used as a convenient way to
- specify an empty EventArgs instance.
-
-
-
-
- Whether the event has been canceled.
-
-
-
-
- The char data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The string representation of the value.
-
-
-
- Converts the value to its string representation.
-
- The string representation of the value.
-
-
-
- Provides access to the arguments of the current function.
-
-
-
-
- Retrieves the specified actual argument value passed to the
- function by index.
-
- The index of the argument to retrieve.
- The value of the specified argument.
-
-
-
- Retrieves the number of actual arguments passed to the function.
-
- The count of arguments.
-
-
-
- Equivalent to the Date type in Javascript, but emulates value-type semantics by removing all mutators.
-
-
-
-
- Creates a new instance of Date initialized from the specified number of milliseconds.
-
- Milliseconds since January 1st, 1970.
-
-
-
- Creates a new instance of Date initialized from parsing the specified date.
-
-
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (1 through 12)
- The day of the month (1 through # of days in the specified month)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (1 through 12)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (1 through 12)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (1 through 12)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
- The seconds (0 through 59)
-
-
-
- Creates a new instance of Date.
-
- The full year.
- The month (1 through 12)
- The day of the month (1 through # of days in the specified month)
- The hours (0 through 23)
- The minutes (0 through 59)
- The seconds (0 through 59)
- The milliseconds (0 through 999)
-
-
-
- Returns the difference in milliseconds between two dates.
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Compares two dates
-
-
-
-
- Converts a DateTime to a JsDate. Returns a copy of the immutable datetime.
-
-
-
-
- Converts a JsDate to a DateTime. Returns a copy of the mutable datetime.
-
-
-
-
- Returns a new that adds the specified number of days to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of days represented by .
-
- A number of whole and fractional days. The parameter can be negative or positive.
-
-
-
- Returns a new that adds the specified number of hours to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of hours represented by .
-
- A number of whole and fractional hours. The parameter can be negative or positive.
-
-
-
- Returns a new that adds the specified number of milliseconds to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by .
-
- A number of whole and fractional milliseconds. The parameter can be negative or positive. Note that this value is rounded to the nearest integer.
-
-
-
- Returns a new that adds the specified number of minutes to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of minutes represented by .
-
- A number of whole and fractional minutes. The parameter can be negative or positive.
-
-
-
- Returns a new that adds the specified number of months to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and .
-
- A number of months. The parameter can be negative or positive.
-
-
-
- Returns a new that adds the specified number of seconds to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of seconds represented by .
-
- A number of whole and fractional seconds. The parameter can be negative or positive.
-
-
-
- Returns a new that adds the specified number of years to the value of this instance.
-
-
- An object whose value is the sum of the date and time represented by this instance and the number of years represented by .
-
- A number of years. The parameter can be negative or positive.
-
-
-
- Returns the number of days in the specified month and year.
-
-
- The number of days in for the specified .For example, if equals 2 for February, the return value is 28 or 29 depending upon whether is a leap year.
-
- The year. The month (a number ranging from 1 to 12).
-
-
-
- Returns an indication whether the specified year is a leap year.
-
-
- true if is a leap year; otherwise, false.
-
- A 4-digit year.
-
-
-
- Compares two instances of and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.
-
-
- A signed number indicating the relative values of and .Value Type Condition Less than zero is earlier than . Zero is the same as . Greater than zero is later than .
-
- The first object to compare. The second object to compare.
-
-
-
- Returns a value indicating whether two instances have the same date and time value.
-
-
- true if the two values are equal; otherwise, false.
-
- The first object to compare. The second object to compare.
-
-
-
- Returns the current date and time.
-
-
-
-
- Returns the current date and time according to UTC
-
-
-
-
- Gets the current date.
-
-
- An object that is set to today's date, with the time component set to 00:00:00.
-
-
-
-
- Gets the date component of this instance.
-
-
- A new object with the same date as this instance, and the time value set to 12:00:00 midnight (00:00:00).
-
-
-
-
- Gets the day of the month represented by this instance.
-
-
- The day component, expressed as a value between 1 and 31.
-
- 1
-
-
-
- Gets the day of the week represented by this instance.
-
-
- An enumerated constant that indicates the day of the week of this value.
-
-
-
-
- Gets the day of the year represented by this instance.
-
-
- The day of the year, expressed as a value between 1 and 366.
-
-
-
-
- Gets the hour component of the date represented by this instance.
-
-
- The hour component, expressed as a value between 0 and 23.
-
-
-
-
- Gets the milliseconds component of the date represented by this instance.
-
-
- The milliseconds component, expressed as a value between 0 and 999.
-
-
-
-
- Gets the minute component of the date represented by this instance.
-
-
- The minute component, expressed as a value between 0 and 59.
-
-
-
-
- Gets the month component of the date represented by this instance.
-
-
- The month component, expressed as a value between 1 and 12.
-
-
-
-
- Gets the seconds component of the date represented by this instance.
-
-
- The seconds component, expressed as a value between 0 and 59.
-
-
-
-
- Gets the year component of the date represented by this instance.
-
-
- The year, between 1 and 9999.
-
-
-
-
- The decimal data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The exponential representation
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The number of digits after the decimal point from 0 - 20
- The exponential representation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The fixed-point notation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The number of digits after the decimal point from 0 - 20
- The fixed-point notation
-
-
-
- Returns a string containing the number represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The string representation of the value.
-
-
-
- Returns a string containing the number represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The number of significant digits (in the range 1 to 21)
- The string representation of the value.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The double data type which is mapped to the Number type in Javascript.
-
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The exponential representation
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The number of digits after the decimal point from 0 - 20
- The exponential representation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The fixed-point notation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The number of digits after the decimal point from 0 - 20
- The fixed-point notation
-
-
-
- Returns a string containing the value represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The string representation of the value.
-
-
-
- Returns a string containing the value represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The number of significant digits (in the range 1 to 21)
- The string representation of the value.
-
-
-
- Delegate for handling generic events.
-
- The object that raised the event.
- The object that contains the event data.
-
-
-
- Equivalent to the Function type in Javascript.
-
-
-
-
- Creates a new function with the specified implementation, and the
- set of named parameters.
-
- Argument names, followed by the function body.
-
-
-
- Creates a new function with the specified implementation, and the
- set of named parameters.
-
- List of comma separated argument names
- The function body
-
-
-
- Creates a new function with the specified implementation, and the
- set of named parameters.
-
- Argument names
- The function body
-
-
-
- Invokes the function against the specified object instance.
-
- The object used as the value of 'this' within the function.
- Any return value returned from the function.
-
-
-
- Invokes the function against the specified object instance.
-
- The object used as the value of 'this' within the function.
- The set of arguments to pass in into the function.
- Any return value returned from the function.
-
-
-
- Invokes the function against the specified object instance.
-
- The object used as the value of 'this' within the function.
- Any return value returned from the function.
-
-
-
- Invokes the function against the specified object instance.
-
- The object used as the value of 'this' within the function.
- One or more arguments to pass in into the function.
- Any return value returned from the function.
-
-
-
- Gets the number of parameters expected by the function.
-
-
-
-
- The short data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The int data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The long data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- Equivalent to the Math object in Javascript.
-
-
-
-
- Equivalent to the RegExp type in Javascript.
-
-
-
-
- The signed byte data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The Script class contains various methods that represent global
- methods present in the underlying script engine.
-
-
-
-
- Converts an object into a boolean.
-
- The object to convert.
- true if the object is not null, zero, empty string or undefined.
-
-
-
- Enables you to evaluate (or execute) an arbitrary script
- literal. This includes JSON literals, where the return
- value is the deserialized object graph.
-
- The script to be evaluated.
- The result of the evaluation.
-
-
-
- Checks if the specified object is null.
-
- The object to test against null.
- true if the object is null; false otherwise.
-
-
-
- Checks if the specified object is null or undefined.
- The object passed in should be a local variable, and not
- a member of a class (to avoid potential script warnings).
-
- The object to test against null or undefined.
- true if the object is null or undefined; false otherwise.
-
-
-
- Checks if the specified object is undefined.
- The object passed in should be a local variable, and not
- a member of a class (to avoid potential script warnings).
-
- The object to test against undefined.
- true if the object is undefined; false otherwise.
-
-
-
- Checks if the specified object has a value, i.e. it is not
- null or undefined.
-
- The object to test.
- true if the object represents a value; false otherwise.
-
-
-
- Returns the first argument if it is not null or undefined, otherwise the second.
-
-
-
-
- Reinterpret an object as another type without performing any type checks. 'Script.Reinterpret<SomeType>(a)' will always compile to 'a' regardless of types.
-
-
-
-
- Returns the result of Javascript 'typeof' operator.
-
-
-
-
- Generate delete obj[member].
-
-
-
-
- Generate member in obj.
-
-
-
-
- Returns the undefined object.
-
-
-
-
- Returns the Javascript 'this'. Might be useful sometimes, but there are usually better ways of doing whatever is being done.
-
-
-
-
- The float data type which is mapped to the Number type in Javascript.
-
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The exponential representation
-
-
-
- Returns a string containing the value represented in exponential notation.
-
- The number of digits after the decimal point (0 - 20)
- The exponential representation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The fixed-point notation
-
-
-
- Returns a string representing the value in fixed-point notation.
-
- The number of digits after the decimal point from 0 - 20
- The fixed-point notation
-
-
-
- Returns a string containing the value represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The string representation of the value.
-
-
-
- Returns a string containing the value represented either in exponential or
- fixed-point notation with a specified number of digits.
-
- The number of significant digits (in the range 1 to 21)
- The string representation of the value.
-
-
-
- Equivalent to the String type in Javascript.
-
-
-
-
- An empty zero-length string.
-
-
-
-
- Retrieves the character at the specified position.
-
- The specified 0-based position.
- The character within the string.
-
-
-
- Retrieves the character code of the character at the specified position.
-
- The specified 0-based position.
- The character code of the character within the string.
-
-
-
- Concatenates a set of individual strings into a single string.
-
- The sequence of strings
- The concatenated string.
-
-
-
- Returns the unencoded version of a complete encoded URI.
-
- The unencoded string.
-
-
-
- Returns the unencoded version of a single part or component of an encoded URI.
-
- The unencoded string.
-
-
-
- Encodes the complete URI.
-
- The encoded string.
-
-
-
- Encodes a single part or component of a URI.
-
- The encoded string.
-
-
-
- Determines if the string ends with the specified character.
-
- The character to test for.
- true if the string ends with the character; false otherwise.
-
-
-
- Determines if the string ends with the specified substring or suffix.
-
- The string to test for.
- true if the string ends with the suffix; false otherwise.
-
-
-
- Determines if the strings are equal.
-
- true if the string s1 = s2; false otherwise.
-
-
-
- Encodes a string by replacing punctuation, spaces etc. with their escaped equivalents.
-
- The escaped string.
-
-
-
- Decodes a string by replacing escaped parts with their equivalent textual representation.
-
- The unescaped string.
-
-
-
- The number of characters in the string.
-
-
-
-
- Provides an optimized mechanism to concatenate strings.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
-
- The string that is used to initialize the value of the instance.
-
-
-
-
- Appends a boolean value to the end of the instance.
-
- The boolean value to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a character to the end of the instance.
-
- The character to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a number to the end of the instance.
-
- The number to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a number to the end of the instance.
-
- The number to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends an object's string representation to the end of the instance.
-
- The object to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends the specified string to the end of the instance.
-
- The string to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a string with a line terminator to the end of the instance.
-
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a boolean with a line terminator to the end of the instance.
-
- The boolean value to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a character with a line terminator to the end of the instance.
-
- The character to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a number with a line terminator to the end of the instance.
-
- The number to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a number with a line terminator to the end of the instance.
-
- The number to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends an object's string representation with a line terminator to the end of the
- instance.
-
- The object to append to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Appends a string with a line terminator to the end of the instance.
-
- The string to append with a line terminator to the end of the StringBuilder instance.
- A reference to this instance after the append operation has completed.
-
-
-
- Clears the contents of the instance.
-
-
-
-
- Creates a string from the contents of a instance.
-
- A string representation of the StringBuilder instance.
-
-
-
- Gets whether the object has any content.
-
- true if the StringBuilder instance contains no text; otherwise, false.
-
-
-
- Gets the length of the StringBuilder content.
-
- length of the StringBuilder content.
-
-
-
- The Type data type which is mapped to the Function type in Javascript.
-
-
-
-
- Gets the prototype associated with the type.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- Use this type when interacting with external libraries that accept arguments that can be of different types.
-
-
-
-
- The ushort data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The uint data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
- The ulong data type which is mapped to the Number type in Javascript.
-
-
-
-
- Converts the value to its string representation.
-
- The radix used in the conversion (eg. 10 for decimal, 16 for hexadecimal)
- The string representation of the value.
-
-
-
diff --git a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/install.ps1 b/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/install.ps1
deleted file mode 100644
index 142f2f5..0000000
--- a/packages/Saltarelle.Runtime.3.0-alpha-0002/tools/install.ps1
+++ /dev/null
@@ -1,20 +0,0 @@
-Param($installPath, $toolsPath, $package, $project)
-
-Function MakeRelativePath($Origin, $Target) {
- $originUri = New-Object Uri('file://' + $Origin)
- $targetUri = New-Object Uri('file://' + $Target)
- $originUri.MakeRelativeUri($targetUri).ToString().Replace('/', [System.IO.Path]::DirectorySeparatorChar)
-}
-
-Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
-$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
-
-# Add a reference to our custom mscorlib.dll (adding this reference by putting the file in the lib/ folder does not work).
-$old = @($msbuild.GetItems("Reference") | ? { $_.UnevaluatedInclude -eq "mscorlib" })
-$old | % { $msbuild.RemoveItem($_) }
-
-$mscorlib = $msbuild.AddItem("Reference", "mscorlib") | Select-Object -First 1
-$mscorlib.SetMetadataValue("HintPath", "`$(SolutionDir)$(MakeRelativePath -Origin $project.DTE.Solution.FullName -Target ([System.IO.Path]::Combine($toolsPath, ""Assemblies"", ""mscorlib.dll"")))")
-
-# Remove the dummy file we have to create in order to have our installer being called by NuGet
-$project.ProjectItems | ? { $_.Name -eq "dummy.txt" } | % { $_.Delete() }
\ No newline at end of file