用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomacox74/js2il --skill test262-porting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | test262-porting |
| description | Port upstream test262 cases and extend the native C# test262 harness when a fixture requires another helper. |
| tier | standard |
| applyTo | tests/Jroc.Test262.Tests/**,tests/Jroc.Testing/Test262/**,tests/test262/**,.github/copilot-instructions.md |
Use this skill when you need to port one or more upstream test262 tests into tests\Jroc.Test262.Tests.
Keep the upstream test262 case as the source of truth by copying the JavaScript fixture exactly as-is whenever it is brought into this repo.
test262 file and preserve its relative spec path and base filename.tests\Jroc.Test262.Tests\...\JavaScript\, using the same filename so the port still clearly maps back to the original source.assert.sameValue(...), assert(...), or other upstream checks into console.log(...),"use strict";,additionalFiles pattern,includes, flags, and negative; the shared C# harness uses it to select helpers and validate expected failures,ExecutionTests.cs entry so:
DisplayName is the original test262 filename,All test262 harness support lives under tests/Jroc.Testing/Test262.
| File | Responsibility |
|---|---|
Test262SharedAssertHarness.cs | Parses frontmatter, injects onlyStrict when needed, selects native helpers from includes, compiles and executes the fixture, checks runtime-negative exception types, and enforces no output. |
Test262HostRuntimeIntrinsics.cs | Registers the core host globals and dispatches optional helper registration. |
Test262PropertyHelpers.cs | Implements propertyHelper.js descriptor and attribute checks. |
Test262TypedArrayHelpers.cs | Implements typed-array constructor lists, argument factories, and callback matrices. |
Test262AtomicsHelpers.cs | Implements Atomics index and non-view value matrices. |
Test262EncodingHelpers.cs | Implements hexadecimal encoding helpers. |
Test262PromiseHelpers.cs | Implements promise sequence and settled-result checks. |
The harness does not read, concatenate, or compile helper JavaScript. The
tests/Jroc.Test262.Tests/Harness directory was removed.
Test262SharedAssertHarness reads the fixture's includes array and passes it
to Test262HostRuntimeIntrinsics.Create. Core globals are always available:
assert, backed by the production JavaScriptRuntime.Node.AssertModule;Test262Error, $ERROR, $DONE, and $262;compareArray, isConstructor, getWellKnownIntrinsicObject,
assertRelativeDateMs, and asyncTest;Other helper groups are registered only when their upstream filename appears
in includes, for example testTypedArray.js, testAtomics.js,
decimalToHexString.js, promiseHelper.js, tcoHelper.js, or nans.js.
This keeps runtime setup small while preserving the upstream metadata contract.
Assertions do not print success markers. A normal test passes by completing
with empty output. assert failures throw AssertionError. Runtime-negative
tests that intentionally leave an exception unhandled are validated against
the frontmatter negative.type; tests that catch an expected exception with
assert.throws execute normally.
When a newly ported fixture names a helper that is not implemented:
Test262<Name>Helpers.cs file under
tests/Jroc.Testing/Test262. Use a Register(...) entry point when the
helper exposes multiple globals.Test262HostRuntimeIntrinsics.CreateFunction, including the upstream
function name and length. Use ObjectRuntime, TypeUtilities,
Closure, JsNull, and public runtime objects so behavior follows JROC's
JavaScript semantics rather than CLR shortcuts.Test262HostRuntimeIntrinsics.Create keyed
by the exact upstream include filename. Register unconditionally only when
existing hand-ported fixtures demonstrably rely on the helper without
frontmatter, and document that reason beside the registration.null (JavaScript undefined) and JsNull.Null (JavaScript null).tests/Jroc.Test262.Tests/Integration/JavaScript/test262NativeHostHelpers.js
with the helper filename in includes and assertions covering its native
globals. Also run representative real fixtures that exercise its edge cases.tests/Jroc.Test262.Tests/Harness, prepend helper source to
fixtures, or weaken copied assertions to make a port pass.Typed-array constructors require particular care. Pass JavaScript-visible, constructible adapters rather than raw CLR delegates, and preserve the upstream constructor/argument-factory callback matrix so moving the helper to C# does not silently reduce test coverage.
tests\Jroc.Tests\... regression unless we specifically need generator/IL assertions or other project-specific coverage beyond what the test262 port already proves.test262 layout recognizable. The path and filename are the main breadcrumb back to the upstream test.tests\Jroc.Test262.Tests\...\JavaScript\*.js fixtures to fit the local harness. Fix missing support in the native C# harness or product runtime.caller / arguments scenario belongs under tests\Jroc.Test262.Tests\language\expressions\arrow-function\, and the parallel tests\Jroc.Tests\ArrowFunction\ArrowFunction_RestrictedCallerArgumentsProperties regression is redundant.Jroc.Test262.Tests suite for the affected area.When a new test262 case changes the documented support story, update the relevant ECMA-262 docs and changelog entry in the same PR.