mirror of
https://github.com/msojocs/wx-compiler.git
synced 2025-07-19 00:00:04 +08:00
fix: wcsc 索引与 一个括号
处理一处索引出现负数的问题; 一处css输出了多余的括号。
This commit is contained in:
parent
6797471f38
commit
ee32f8dd93
@ -7,6 +7,7 @@ module.exports = {
|
|||||||
// spec: "./test/spec/**/*.spec.ts",
|
// spec: "./test/spec/**/*.spec.ts",
|
||||||
spec: [
|
spec: [
|
||||||
"./test/spec/**/*.spec.ts",
|
"./test/spec/**/*.spec.ts",
|
||||||
|
// 'test/spec/issue/129/issue129.spec.ts',
|
||||||
// 'test/spec/issue/115/issue115.spec.ts',
|
// 'test/spec/issue/115/issue115.spec.ts',
|
||||||
// 'test/spec/wcc/module/module.spec.ts',
|
// 'test/spec/wcc/module/module.spec.ts',
|
||||||
],
|
],
|
||||||
|
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
@ -4,6 +4,18 @@
|
|||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Linux module test",
|
||||||
|
"program": "${workspaceFolder}/cache/nwjs-sdk-v0.55.0-linux-x64/nw",
|
||||||
|
"args": [
|
||||||
|
"${workspaceFolder}/test/runner/nwjs/compiler.js",
|
||||||
|
"wcsc",
|
||||||
|
"${workspaceFolder}/test/spec/issue/129/data/example.json"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "wcc wxs sample2",
|
"name": "wcc wxs sample2",
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -86,5 +86,6 @@
|
|||||||
"--background-index",
|
"--background-index",
|
||||||
"--compile-commands-dir=${workspaceFolder}/build/"
|
"--compile-commands-dir=${workspaceFolder}/build/"
|
||||||
],
|
],
|
||||||
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler"
|
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler",
|
||||||
|
"clangd.path": "clangd-18"
|
||||||
}
|
}
|
@ -1,3 +1,10 @@
|
|||||||
|
## 🌈 v0.1.2 / 2025-02-16
|
||||||
|
|
||||||
|
🐞 Bug Fixes
|
||||||
|
|
||||||
|
- `WXML::RPX::accept`: 数组出现负数的问题。
|
||||||
|
- `WXML::Rewrite::RewriteImg`: 输出了多余的右括号。
|
||||||
|
|
||||||
## 🌈 v0.1.1 / 2024-08-10
|
## 🌈 v0.1.1 / 2024-08-10
|
||||||
|
|
||||||
🐞 Bug Fixes
|
🐞 Bug Fixes
|
||||||
|
@ -301,7 +301,7 @@ namespace WXML {
|
|||||||
{
|
{
|
||||||
std::stringstream v29;
|
std::stringstream v29;
|
||||||
v29 << "url(" << sa << "-do-not-use-local-path-" << a3;
|
v29 << "url(" << sa << "-do-not-use-local-path-" << a3;
|
||||||
v29 << "&" << a4 << "&" << a5 << ")";
|
v29 << "&" << a4 << "&" << a5;
|
||||||
std::string v26 = v29.str();
|
std::string v26 = v29.str();
|
||||||
a2 += v26;
|
a2 += v26;
|
||||||
result = 1;
|
result = 1;
|
||||||
|
@ -33,7 +33,7 @@ namespace WXML
|
|||||||
for (i = a3; i > 0; i--)
|
for (i = a3; i > 0; i--)
|
||||||
{
|
{
|
||||||
v7 = v4;
|
v7 = v4;
|
||||||
v4 = a1[266 * v4 + *a4]; // 266 * 4 = 0x428
|
v4 = a1[266 * v4 + (uint8_t)*a4]; // 266 * 4 = 0x428
|
||||||
if (v4 == -1)
|
if (v4 == -1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
270
test/spec/issue/129/data/example.json
Normal file
270
test/spec/issue/129/data/example.json
Normal file
File diff suppressed because one or more lines are too long
38
test/spec/issue/129/issue129.spec.ts
Normal file
38
test/spec/issue/129/issue129.spec.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import assert from "assert"
|
||||||
|
import path from "path"
|
||||||
|
import { describe } from "mocha";
|
||||||
|
import linux from '../../../runner/module-linux'
|
||||||
|
import windows from '../../../runner/module-windows'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
|
||||||
|
describe("issue - 129", function () {
|
||||||
|
describe("issue: linux output should equal with wine", function () {
|
||||||
|
it("crash", async function () {
|
||||||
|
const p = path.resolve(__dirname, './data/example.json')
|
||||||
|
const storagePath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
`issue-129/${this.test?.title}`
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(storagePath, { recursive: true });
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
|
const w = await windows.wcsc(p);
|
||||||
|
const n = await linux.wcsc(p, '', storagePath);
|
||||||
|
// console.log('windows:', typeof w)
|
||||||
|
// console.log('linux:', typeof n)
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
`${storagePath}/wine-output.json`,
|
||||||
|
JSON.stringify(w, null, 4)
|
||||||
|
);
|
||||||
|
fs.writeFileSync(
|
||||||
|
`${storagePath}/node-output.json`,
|
||||||
|
JSON.stringify(n, null, 4)
|
||||||
|
);
|
||||||
|
assert.equal(typeof n, typeof w);
|
||||||
|
assert.equal(w.success, true)
|
||||||
|
assert.deepEqual(n, w);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
4
test/spec/issue/129/prepare.sh
Executable file
4
test/spec/issue/129/prepare.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
dir=$(cd `dirname $0` && pwd -P)
|
||||||
|
|
3
test/test-linux-module.sh
Executable file
3
test/test-linux-module.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/home/msojocs/github/wx-compiler/cache/nwjs-sdk-v0.55.0-linux-x64/nw /home/msojocs/github/wx-compiler/test/runner/nwjs/compiler.js wcsc /home/msojocs/github/wx-compiler/test/spec/issue/129/data/example.json
|
Loading…
x
Reference in New Issue
Block a user