-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance improvement and Primitive Object properties bug fixed
- Loading branch information
Showing
19 changed files
with
3,701 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\YantraJS.Core\YantraJS.Core.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include=".\Scripts\*.*" CopyToOutputDirectory="PreserveNewest" /> | ||
<None Include="..\Jint.Tests.CommonScripts\Scripts\**" CopyToOutputDirectory="PreserveNewest" LinkBase="Scripts" /> | ||
</ItemGroup> | ||
|
||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using YantraJS.Core.FastParser; | ||
|
||
public class Program | ||
{ | ||
|
||
private static readonly Dictionary<string, string> _files = new() | ||
{ | ||
{ "array-stress", null }, | ||
{ "evaluation", null }, | ||
{ "linq-js", null }, | ||
{ "minimal", null }, | ||
{ "stopwatch", null }, | ||
{ "dromaeo-3d-cube", null }, | ||
{ "dromaeo-core-eval", null }, | ||
{ "dromaeo-object-array", null }, | ||
{ "dromaeo-object-regexp", null }, | ||
{ "dromaeo-object-string", null }, | ||
{ "dromaeo-string-base64", null }, | ||
}; | ||
|
||
private static readonly string _dromaeoHelpers = @" | ||
var startTest = function () { }; | ||
var test = function (name, fn) { fn(); }; | ||
var endTest = function () { }; | ||
var prep = function (fn) { fn(); };"; | ||
|
||
|
||
public static void Main() | ||
{ | ||
|
||
var files = _files.Keys.ToList(); | ||
|
||
foreach(var fileName in files) | ||
{ | ||
var script = File.ReadAllText($"Scripts/{fileName}.js"); | ||
if (fileName.Contains("dromaeo")) | ||
{ | ||
script = _dromaeoHelpers + Environment.NewLine + Environment.NewLine + script; | ||
} | ||
_files[fileName] = script; | ||
} | ||
|
||
foreach (var item in files) | ||
{ | ||
var content = _files[item]; | ||
var engine = new YantraJS.Core.JSContext(); | ||
// By default YantraJS is strict mode only, in strict mode | ||
// unless you pass `this`, `this` in a global context is undefined. | ||
engine.Eval(content, item + ".js", engine); | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.