Commit d4d81e07 authored by wang's avatar wang

ws 测试

parent 2b84733f
......@@ -4786,7 +4786,7 @@ ENV2 = {
}
// ENV = ENV2
ENV = ENV2
// ENV.windowparams = ENV2.windowparams
// // ENV.navigatorparams = ENV2.navigatorparams
// let v = parseInt(Math.random()*10 + 100);
......@@ -6817,9 +6817,9 @@ Object.defineProperties(TextMetrics.prototype, {
let res = 132.39996337890625 * (Math.random() * 0.1 + 0.9)
if (ENV.fontsres[this.font] && ENV.fontsres[this.font][this.text]) {
res = ENV.fontsres[this.font][this.text].width + fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0
res = ENV.fontsres[this.font][this.text].width + (fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0)
}
print(this.text[0], " [*] TextMetrics -> width[get]", width);
print(this.text, " [*] TextMetrics -> width[get]", res);
return res;
}
......@@ -6829,7 +6829,7 @@ Object.defineProperties(TextMetrics.prototype, {
let res = 556.640625 * (Math.random() * 0.1 + 0.9)
if (ENV.fontsres[this.font] && ENV.fontsres[this.font][this.text]) {
res = ENV.fontsres[this.font][this.text].actualboundingboxascent + fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0
res = ENV.fontsres[this.font][this.text].actualboundingboxascent + (fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0)
}
print(" [*] TextMetrics -> actualBoundingBoxAscent[get]", res);
return res;
......@@ -6840,7 +6840,7 @@ Object.defineProperties(TextMetrics.prototype, {
let res = -203.61328125 * (Math.random() * 0.1 + 0.9)
if (ENV.fontsres[this.font] && ENV.fontsres[this.font][this.text]) {
return ENV.fontsres[this.font][this.text].actualboundingboxdescent + fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0
return ENV.fontsres[this.font][this.text].actualboundingboxdescent + (fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0)
}
print(" [*] TextMetrics -> actualBoundingBoxDescent[get]", res);
......@@ -6852,7 +6852,7 @@ Object.defineProperties(TextMetrics.prototype, {
let res = -22.94921875 * (Math.random() * 0.1 + 0.9)
if (ENV.fontsres[this.font] && ENV.fontsres[this.font][this.text]) {
res = ENV.fontsres[this.font][this.text].actualboundingboxleft + fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0
res = ENV.fontsres[this.font][this.text].actualboundingboxleft + (fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0)
}
print(" [*] TextMetrics -> actualBoundingBoxLeft[get]", res);
return res;
......@@ -6863,7 +6863,7 @@ Object.defineProperties(TextMetrics.prototype, {
let res = 579.1015625 * (Math.random() * 0.1 + 0.9)
if (ENV.fontsres[this.font] && ENV.fontsres[this.font][this.text]) {
res = ENV.fontsres[this.font][this.text].actualboundingboxright + fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0
res = ENV.fontsres[this.font][this.text].actualboundingboxright + (fontSizeRandom ? (Math.random() * 0.1 + 0.9) : 0)
}
print(" [*] TextMetrics -> actualBoundingBoxRight[get]", res);
return res;
......@@ -11706,17 +11706,17 @@ window.performance = {
}
// window.Proxy = window
window.BigInt = BigInt
_hasOwnProperty = Object.hasOwnProperty
// Object.hasOwnProperty = v_saf(function (a){
// _hasOwnProperty = Object.hasOwnProperty
// Object.hasOwnProperty = v_saf(function (a) {
// let res = _hasOwnProperty.call(this, a);
// print(' hasOwnProperty', a, res)
//
// return res;
// })
// window.hasOwnProperty = function hasOwnProperty() {
// _console2('window hasOwnProperty', arguments)
// return window[arguments['0']]
// }
window.hasOwnProperty = function hasOwnProperty() {
print('window hasOwnProperty', arguments)
return window[arguments['0']]
}
DOMTokenList = v_saf(function DOMTokenList() {
})
......@@ -12510,6 +12510,25 @@ window.External = External;
window.Blob = Blob;
window.Comment = Comment;
window.Document = Document;
DOMException = v_saf(function DOMException(message) {
this.message = message;
this.name = 'DOMException';
// Ensure stack trace works fine
if (Error.captureStackTrace) {
Error.captureStackTrace(this, DOMException);
} else {
this.stack = (new Error()).stack;
}
mm.memory.private_data.set(this, {
message:message
})
})
// 使用原型链继承 Error
DOMException.prototype = Object.create(Error.prototype);
DOMException.prototype.constructor = DOMException;
global.DOMException = DOMException;
window.DOMException = DOMException;
window.DOMMatrixReadOnly = DOMMatrixReadOnly;
window.RTCPeerConnection = RTCPeerConnection;
......@@ -12526,8 +12545,21 @@ window.Path2D = Path2D;
window.PerformanceObserver = PerformanceObserver;
window.ReadableStream = ReadableStream;
window.Text = Text;
window.TextDecoderStream = TextDecoderStream;
window.TextEncoderStream = TextEncoderStream;
window.TextDecoderStream = v_saf(function TextDecoderStream(){
return new TextDecoderStream(...arguments)
});
window.TextEncoder = v_saf(function TextEncoder(){
return new TextEncoder(...arguments)
});
window.TextDecoder = v_saf(function TextDecoder(){
return new TextDecoder(...arguments)
});
window.AbortSignal = v_saf(function AbortSignal(){
return AbortSignal(...arguments)
});
window.TextEncoderStream = v_saf(function TextEncoderStream(){
return new TextEncoderStream(...arguments)
});;
window.TransformStream = TransformStream;
window.URLSearchParams = URLSearchParams;
window.XMLHttpRequest = XMLHttpRequest;
......@@ -16342,26 +16374,13 @@ Object.defineProperties(Worker.prototype, {
;
;
;
;
;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment