| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2812f30 commit f764372
674 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | #pragma once | |
| 7 | 7 | ||
| 8 | - #define CLEARSCRIPT_VERSION_STRING "7.3.0" | ||
| 9 | - #define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,3,0 | ||
| 10 | - #define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.3.0" | ||
| 8 | + #define CLEARSCRIPT_VERSION_STRING "7.3.1" | ||
| 9 | + #define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,3,1 | ||
| 10 | + #define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.3.1" | ||
| 11 | 11 | #define CLEARSCRIPT_FILE_FLAGS 0L | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -537,6 +537,12 @@ private bool BindSpecialTarget<T>(out T specialTarget) where T : class | |||
| 537 | 537 | return specialTarget != null; | |
| 538 | 538 | } | |
| 539 | 539 | ||
| 540 | + if (Target.Type.IsAssignableToGenericType(typeof(IReadOnlyList<>), out typeArgs)) | ||
| 541 | + { | ||
| 542 | + specialTarget = typeof(ReadOnlyHostList<>).MakeGenericType(typeArgs).CreateInstance(Engine, Target.InvokeTarget) as T; | ||
| 543 | + return specialTarget != null; | ||
| 544 | + } | ||
| 545 | + | ||
| 540 | 546 | specialTarget = null; | |
| 541 | 547 | return false; | |
| 542 | 548 | } | |
@@ -1542,7 +1548,7 @@ private object GetHostProperty(PropertyInfo property, BindingFlags invokeFlags, | |||
| 1542 | 1548 | var getMethod = property.GetMethod; | |
| 1543 | 1549 | if ((getMethod == null) || !getMethod.IsAccessible(AccessContext) || getMethod.IsBlockedFromScript(DefaultAccess, false)) | |
| 1544 | 1550 | { | |
| 1545 | - throw new UnauthorizedAccessException("Property get method is unavailable or inaccessible"); | ||
| 1551 | + throw new UnauthorizedAccessException("The property get method is unavailable or inaccessible"); | ||
| 1546 | 1552 | } | |
| 1547 | 1553 | ||
| 1548 | 1554 | var result = property.GetValue(Target.InvokeTarget, invokeFlags, Type.DefaultBinder, args, culture); | |
@@ -1628,7 +1634,7 @@ private object SetHostProperty(string name, BindingFlags invokeFlags, object[] a | |||
| 1628 | 1634 | { | |
| 1629 | 1635 | if (field.IsLiteral || field.IsInitOnly || field.IsReadOnlyForScript(DefaultAccess)) | |
| 1630 | 1636 | { | |
| 1631 | - throw new UnauthorizedAccessException("Field is read-only"); | ||
| 1637 | + throw new UnauthorizedAccessException("The field is read-only"); | ||
| 1632 | 1638 | } | |
| 1633 | 1639 | ||
| 1634 | 1640 | var value = args[0]; | |
@@ -1651,13 +1657,13 @@ private object SetHostProperty(PropertyInfo property, BindingFlags invokeFlags, | |||
| 1651 | 1657 | { | |
| 1652 | 1658 | if (property.IsReadOnlyForScript(DefaultAccess)) | |
| 1653 | 1659 | { | |
| 1654 | - throw new UnauthorizedAccessException("Property is read-only"); | ||
| 1660 | + throw new UnauthorizedAccessException("The property is read-only"); | ||
| 1655 | 1661 | } | |
| 1656 | 1662 | ||
| 1657 | 1663 | var setMethod = property.SetMethod; | |
| 1658 | 1664 | if ((setMethod == null) || !setMethod.IsAccessible(AccessContext) || setMethod.IsBlockedFromScript(DefaultAccess, false)) | |
| 1659 | 1665 | { | |
| 1660 | - throw new UnauthorizedAccessException("Property set method is unavailable or inaccessible"); | ||
| 1666 | + throw new UnauthorizedAccessException("The property set method is unavailable or inaccessible"); | ||
| 1661 | 1667 | } | |
| 1662 | 1668 | ||
| 1663 | 1669 | var value = args[args.Length - 1]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,4 +72,29 @@ public object this[int index] | |||
| 72 | 72 | ||
| 73 | 73 | #endregion | |
| 74 | 74 | } | |
| 75 | + | ||
| 76 | + internal sealed class ReadOnlyHostList<T> : IHostList | ||
| 77 | + { | ||
| 78 | + private readonly ScriptEngine engine; | ||
| 79 | + private readonly IReadOnlyList<T> list; | ||
| 80 | + | ||
| 81 | + public ReadOnlyHostList(ScriptEngine engine, IReadOnlyList<T> list) | ||
| 82 | + { | ||
| 83 | + this.engine = engine; | ||
| 84 | + this.list = list; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + #region IHostList implementation | ||
| 88 | + | ||
| 89 | + public int Count => list.Count; | ||
| 90 | + | ||
| 91 | + public object this[int index] | ||
| 92 | + { | ||
| 93 | + get => engine.PrepareResult(list[index], ScriptMemberFlags.None, true); | ||
| 94 | + | ||
| 95 | + set => throw new UnauthorizedAccessException("The object is read-only"); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + #endregion | ||
| 99 | + } | ||
| 75 | 100 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,6 @@ | |||
| 5 | 5 | using System.Collections.Generic; | |
| 6 | 6 | using System.Linq; | |
| 7 | 7 | using System.Reflection; | |
| 8 | - using System.Runtime.InteropServices; | ||
| 9 | 8 | using System.Runtime.InteropServices.ComTypes; | |
| 10 | 9 | using Microsoft.ClearScript.Util; | |
| 11 | 10 | using Microsoft.ClearScript.Util.COM; | |
@@ -232,7 +231,7 @@ private PropertyBag AddEnumTypeInfoInternal(ITypeInfo typeInfo) | |||
| 232 | 231 | if (varDescScope.Value.varkind == VARKIND.VAR_CONST) | |
| 233 | 232 | { | |
| 234 | 233 | var name = typeInfo.GetMemberName(varDescScope.Value.memid); | |
| 235 | - node.SetPropertyNoCheck(name, Marshal.GetObjectForNativeVariant(varDescScope.Value.desc.lpvarValue)); | ||
| 234 | + node.SetPropertyNoCheck(name, MiscHelpers.GetObjectForVariant(varDescScope.Value.desc.lpvarValue)); | ||
| 236 | 235 | } | |
| 237 | 236 | } | |
| 238 | 237 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,15 +18,15 @@ | |||
| 18 | 18 | [assembly: InternalsVisibleTo("ClearScriptTest")] | |
| 19 | 19 | ||
| 20 | 20 | [assembly: ComVisible(false)] | |
| 21 | - [assembly: AssemblyVersion("7.3.0")] | ||
| 22 | - [assembly: AssemblyFileVersion("7.3.0")] | ||
| 23 | - [assembly: AssemblyInformationalVersion("7.3.0")] | ||
| 21 | + [assembly: AssemblyVersion("7.3.1")] | ||
| 22 | + [assembly: AssemblyFileVersion("7.3.1")] | ||
| 23 | + [assembly: AssemblyInformationalVersion("7.3.1")] | ||
| 24 | 24 | ||
| 25 | 25 | namespace Microsoft.ClearScript.Properties | |
| 26 | 26 | { | |
| 27 | 27 | internal static class ClearScriptVersion | |
| 28 | 28 | { | |
| 29 | - public const string Triad = "7.3.0"; | ||
| 30 | - public const string Informational = "7.3.0"; | ||
| 29 | + public const string Triad = "7.3.1"; | ||
| 30 | + public const string Informational = "7.3.1"; | ||
| 31 | 31 | } | |
| 32 | 32 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,6 @@ | |||
| 15 | 15 | [assembly: InternalsVisibleTo("ClearScript.V8")] | |
| 16 | 16 | ||
| 17 | 17 | [assembly: ComVisible(false)] | |
| 18 | - [assembly: AssemblyVersion("7.3.0")] | ||
| 19 | - [assembly: AssemblyFileVersion("7.3.0")] | ||
| 20 | - [assembly: AssemblyInformationalVersion("7.3.0")] | ||
| 18 | + [assembly: AssemblyVersion("7.3.1")] | ||
| 19 | + [assembly: AssemblyFileVersion("7.3.1")] | ||
| 20 | + [assembly: AssemblyInformationalVersion("7.3.1")] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,6 @@ | |||
| 15 | 15 | [assembly: InternalsVisibleTo("ClearScriptTest")] | |
| 16 | 16 | ||
| 17 | 17 | [assembly: ComVisible(false)] | |
| 18 | - [assembly: AssemblyVersion("7.3.0")] | ||
| 19 | - [assembly: AssemblyFileVersion("7.3.0")] | ||
| 20 | - [assembly: AssemblyInformationalVersion("7.3.0")] | ||
| 18 | + [assembly: AssemblyVersion("7.3.1")] | ||
| 19 | + [assembly: AssemblyFileVersion("7.3.1")] | ||
| 20 | + [assembly: AssemblyInformationalVersion("7.3.1")] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,6 @@ | |||
| 16 | 16 | [assembly: InternalsVisibleTo("ClearScriptTest")] | |
| 17 | 17 | ||
| 18 | 18 | [assembly: ComVisible(false)] | |
| 19 | - [assembly: AssemblyVersion("7.3.0")] | ||
| 20 | - [assembly: AssemblyFileVersion("7.3.0")] | ||
| 21 | - [assembly: AssemblyInformationalVersion("7.3.0")] | ||
| 19 | + [assembly: AssemblyVersion("7.3.1")] | ||
| 20 | + [assembly: AssemblyFileVersion("7.3.1")] | ||
| 21 | + [assembly: AssemblyInformationalVersion("7.3.1")] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,6 @@ | |||
| 15 | 15 | [assembly: InternalsVisibleTo("ClearScriptTest")] | |
| 16 | 16 | ||
| 17 | 17 | [assembly: ComVisible(false)] | |
| 18 | - [assembly: AssemblyVersion("7.3.0")] | ||
| 19 | - [assembly: AssemblyFileVersion("7.3.0")] | ||
| 20 | - [assembly: AssemblyInformationalVersion("7.3.0")] | ||
| 18 | + [assembly: AssemblyVersion("7.3.1")] | ||
| 19 | + [assembly: AssemblyFileVersion("7.3.1")] | ||
| 20 | + [assembly: AssemblyInformationalVersion("7.3.1")] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -293,10 +293,31 @@ public bool DisableExtensionMethods | |||
| 293 | 293 | /// Some script languages support one or more special non-<c>null</c> values that represent | |
| 294 | 294 | /// nonexistent, missing, unknown, or undefined data. When such a value is marshaled to the | |
| 295 | 295 | /// host, the script engine maps it to the value of this property. The default value is | |
| 296 | - /// <c><see cref="Undefined.Value"/></c>. | ||
| 296 | + /// <c><see cref="Undefined.Value">Undefined.Value</see></c>. | ||
| 297 | 297 | /// </remarks> | |
| 298 | 298 | public object UndefinedImportValue { get; set; } = Undefined.Value; | |
| 299 | 299 | ||
| 300 | + /// <summary> | ||
| 301 | + /// Gets or sets the engine's null export value. | ||
| 302 | + /// </summary> | ||
| 303 | + /// <remarks> | ||
| 304 | + /// <para> | ||
| 305 | + /// When a null object reference is marshaled to script code, the script engine maps it to | ||
| 306 | + /// the value of this property. The default value is simply <c>null</c>, which corresponds | ||
| 307 | + /// to <c>null</c> or its closest equivalent in the script language. Other useful | ||
| 308 | + /// possibilities include | ||
| 309 | + /// <c><see cref="Undefined.Value">Undefined.Value</see></c> and | ||
| 310 | + /// <c><see href="https://microsoft.github.io/ClearScript/Reference/html/F_Microsoft_ClearScript_Windows_Nothing_Value.htm">Nothing.Value</see></c>. | ||
| 311 | + /// </para> | ||
| 312 | + /// <para> | ||
| 313 | + /// Note that <see cref="ScriptMemberFlags.WrapNullResult"/>, | ||
| 314 | + /// <see cref="EnableNullResultWrapping"/>, and | ||
| 315 | + /// <see href="https://microsoft.github.io/ClearScript/Reference/html/T_Microsoft_ClearScript_Windows_WindowsScriptEngineFlags.htm">MarshalNullAsDispatch</see> | ||
| 316 | + /// all take precedence over this property. | ||
| 317 | + /// </para> | ||
| 318 | + /// </remarks> | ||
| 319 | + public object NullExportValue { get; set; } | ||
| 320 | + | ||
| 300 | 321 | /// <summary> | |
| 301 | 322 | /// Gets or sets the engine's void result export value. | |
| 302 | 323 | /// </summary> | |
@@ -306,7 +327,7 @@ public bool DisableExtensionMethods | |||
| 306 | 327 | /// as a C# | |
| 307 | 328 | /// <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/void">void</see></c> | |
| 308 | 329 | /// method), the script engine returns the value of this property as a dummy result. The | |
| 309 | - /// default value is <c><see cref="VoidResult.Value"/></c>. | ||
| 330 | + /// default value is <c><see cref="VoidResult.Value">VoidResult.Value</see></c>. | ||
| 310 | 331 | /// </remarks> | |
| 311 | 332 | public object VoidResultValue { get; set; } = VoidResult.Value; | |
| 312 | 333 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments