This commit is contained in:
msojocs 2024-07-06 15:15:52 +08:00
parent 99085f9add
commit c75bbaa754
7 changed files with 43 additions and 2204 deletions

View File

@ -98,7 +98,7 @@ int compile(Isolate *isolate, WCCOptions &options, Local<Value> &result,
dependencyListMap, // std::map<std::string,std::vector<std::string>>
componentListMap, // componentListMap
splitedData, mapData1,
true, // isLLA,
options.isCut, // isLLA,
options.genfuncname, mark, 10, &off_5403C3[2], off_5403C3, "gg", "e_",
"d_", "p_", "\0", "boxofchocolate", "$gdwx", "f_");
if (outputContentMap.count("__COMMON__") == 0) {

View File

@ -75,7 +75,7 @@ const wccNative = (optionsPath: string, outputPath: string | undefined = undefin
if (0 === n) {
let result = Buffer.concat(spwanData).toString();
result = result.split('---------------result------------------\n')[1]
process.stdout.write(result);
// process.stdout.write(result);
if (result[0] === '{')
result = JSON.parse(result);
resolve(result);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,47 @@ describe("wcc - module", function () {
console.log('windows:', typeof w)
console.log('linux:', typeof n)
assert.equal(typeof n, typeof w);
if (typeof w == 'string')
{
fs.writeFileSync(
`${storagePath}/wine-output.json`,
w
);
fs.writeFileSync(
`${storagePath}/node-output.json`,
n as string
);
assert.equal(n, w);
}
else
{
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
);
fs.writeFileSync(
`${storagePath}/node-output.json`,
JSON.stringify(n, null, 4)
);
assert.deepEqual(n, w);
}
});
it("初次加载2", async function () {
const p = path.resolve(__dirname, './data/options-1719836863260.json')
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`
);
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = await windows.wcc(p);
const n = await linux.wcc(p, '');
console.log('windows:', typeof w)
console.log('linux:', typeof n)
assert.equal(typeof n, typeof w);
if (typeof w == 'string')
{