1
0
mirror of https://github.com/bnmgh1/NodeSandbox.git synced 2025-04-14 07:03:45 +08:00
Your Name 056619c27f null
2024-03-15 14:39:48 +08:00

28 lines
906 B
JavaScript

this.document_get_location = function () {
let r = cbb_wf.checkIllegal(this, "HTMLDocument");
let ctx = r[0];
if (r[1]) {
// 报错
throw cbb_wf.newError.call(ctx, "Illegal invocation");
}
let result = cbb_wf.getValue(this, "location");
if (cbb_wf.is_log) {
cbb_wf.console.log("[*] document_get_location, this =>", this + '', ", result => ", toString.call(result));
}
return result;
}
this.document_set_location = function (val) {
let r = cbb_wf.checkIllegal(this, "HTMLDocument");
let ctx = r[0];
if (r[1]) {
// 报错
throw cbb_wf.newError.call(ctx, "Illegal invocation");
}
// location.href = val
// let result = cbb_wf.setValue(this, "location", val);
if (cbb_wf.is_log) {
cbb_wf.console.log("[*] document_set_location, this =>", this + '', ", val => ", val + '');
}
return result;
}