Skip to content

Commit f31c7db

Browse files
authored
fix: wcsc 索引与 一个括号 (#12)
* fix: wine environment * fix: wine environment * fix: environment * perf: remove recommend * fix: env * Update release.yml * fix: permission of wcsc.exe * fix: 一处越界问题 * fix: pnpm install * fix: wine prepare * fix: wine cfg * feat: error console * fix: 兼容clang * perf: 调整位置 * perf: 带入环境 * fix: version * perf: log * fix: version check * fix: version * fix: wcsc 索引与 一个括号 处理一处索引出现负数的问题; 一处css输出了多余的括号。 * fix: ci
1 parent 754a098 commit f31c7db

File tree

11 files changed

+342
-6
lines changed

11 files changed

+342
-6
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
ls -l
7272
7373
- name: Upload artifact
74-
uses: actions/upload-artifact@v3
74+
uses: actions/upload-artifact@v4
7575
with:
7676
# Artifact name
7777
name: wx-compiler-${{ matrix.ARCH }}.build
@@ -99,7 +99,7 @@ jobs:
9999
node-version: '18.12.0'
100100
check-latest: false
101101
- name: Download artifacts
102-
uses: actions/download-artifact@v3
102+
uses: actions/download-artifact@v4
103103

104104
- name: Inspect directory after downloading artifacts
105105
run: ls -alFR
@@ -153,7 +153,7 @@ jobs:
153153
runs-on: ubuntu-latest
154154
steps:
155155
- name: Download artifacts
156-
uses: actions/download-artifact@v3
156+
uses: actions/download-artifact@v4
157157
- name: Inspect directory after downloading artifacts
158158
run: ls -alFR
159159

.mocharc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
// spec: "./test/spec/**/*.spec.ts",
88
spec: [
99
"./test/spec/**/*.spec.ts",
10+
// 'test/spec/issue/129/issue129.spec.ts',
1011
// 'test/spec/issue/115/issue115.spec.ts',
1112
// 'test/spec/wcc/module/module.spec.ts',
1213
],

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Linux module test",
11+
"program": "${workspaceFolder}/cache/nwjs-sdk-v0.55.0-linux-x64/nw",
12+
"args": [
13+
"${workspaceFolder}/test/runner/nwjs/compiler.js",
14+
"wcsc",
15+
"${workspaceFolder}/test/spec/issue/129/data/example.json"
16+
],
17+
"cwd": "${workspaceFolder}"
18+
},
719

820
{
921
"name": "wcc wxs sample2",

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@
8686
"--background-index",
8787
"--compile-commands-dir=${workspaceFolder}/build/"
8888
],
89-
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler"
89+
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler",
90+
"clangd.path": "clangd-18"
9091
}

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 🌈 v0.1.2 / 2025-02-16
2+
3+
🐞 Bug Fixes
4+
5+
- `WXML::RPX::accept`: 数组出现负数的问题。
6+
- `WXML::Rewrite::RewriteImg`: 输出了多余的右括号。
7+
18
## 🌈 v0.1.1 / 2024-08-10
29

310
🐞 Bug Fixes

src/wxml/rewrite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ namespace WXML {
301301
{
302302
std::stringstream v29;
303303
v29 << "url(" << sa << "-do-not-use-local-path-" << a3;
304-
v29 << "&" << a4 << "&" << a5 << ")";
304+
v29 << "&" << a4 << "&" << a5;
305305
std::string v26 = v29.str();
306306
a2 += v26;
307307
result = 1;

src/wxml/rpx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace WXML
3333
for (i = a3; i > 0; i--)
3434
{
3535
v7 = v4;
36-
v4 = a1[266 * v4 + *a4]; // 266 * 4 = 0x428
36+
v4 = a1[266 * v4 + (uint8_t)*a4]; // 266 * 4 = 0x428
3737
if (v4 == -1)
3838
{
3939
break;

test/spec/issue/129/data/example.json

Lines changed: 270 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import assert from "assert"
2+
import path from "path"
3+
import { describe } from "mocha";
4+
import linux from '../../../runner/module-linux'
5+
import windows from '../../../runner/module-windows'
6+
import * as fs from 'fs'
7+
8+
describe("issue - 129", function () {
9+
describe("issue: linux output should equal with wine", function () {
10+
it("crash", async function () {
11+
const p = path.resolve(__dirname, './data/example.json')
12+
const storagePath = path.resolve(
13+
__dirname,
14+
`issue-129/${this.test?.title}`
15+
);
16+
try {
17+
fs.mkdirSync(storagePath, { recursive: true });
18+
} catch (error) {}
19+
20+
const w = await windows.wcsc(p);
21+
const n = await linux.wcsc(p, '', storagePath);
22+
// console.log('windows:', typeof w)
23+
// console.log('linux:', typeof n)
24+
25+
fs.writeFileSync(
26+
`${storagePath}/wine-output.json`,
27+
JSON.stringify(w, null, 4)
28+
);
29+
fs.writeFileSync(
30+
`${storagePath}/node-output.json`,
31+
JSON.stringify(n, null, 4)
32+
);
33+
assert.equal(typeof n, typeof w);
34+
assert.equal(w.success, true)
35+
assert.deepEqual(n, w);
36+
});
37+
});
38+
});

test/spec/issue/129/prepare.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/bash
2+
3+
dir=$(cd `dirname $0` && pwd -P)
4+

0 commit comments

Comments
 (0)