新增: - backend/venv/ - Python 虚拟环境 - backend/start.sh - 启动脚本(使用虚拟环境) - backend/requirements.txt - 依赖列表 - .gitignore - 忽略虚拟环境和缓存文件 说明: - 每个项目使用独立虚拟环境 - 避免依赖冲突 - 启动脚本自动创建和激活虚拟环境
23 lines
585 B
JavaScript
23 lines
585 B
JavaScript
"use strict";
|
|
const legacyErrorCodes = require("./legacy-error-codes.json");
|
|
const idlUtils = require("./utils.js");
|
|
|
|
exports.implementation = class DOMExceptionImpl {
|
|
constructor(globalObject, [message, name]) {
|
|
this.name = name;
|
|
this.message = message;
|
|
}
|
|
|
|
get code() {
|
|
return legacyErrorCodes[this.name] || 0;
|
|
}
|
|
};
|
|
|
|
// A proprietary V8 extension that causes the stack property to appear.
|
|
exports.init = impl => {
|
|
if (Error.captureStackTrace) {
|
|
const wrapper = idlUtils.wrapperForImpl(impl);
|
|
Error.captureStackTrace(wrapper, wrapper.constructor);
|
|
}
|
|
};
|