代码拉取完成,页面将自动刷新
package otto
import (
"testing"
)
func Test_panic(t *testing.T) {
tt(t, func() {
test, _ := test()
// Test that property.value is set to something if writable is set
// to something
test(`
var abc = [];
Object.defineProperty(abc, "0", { writable: false });
Object.defineProperty(abc, "0", { writable: false });
"0" in abc;
`, true)
test(`raise:
var abc = [];
Object.defineProperty(abc, "0", { writable: false });
Object.defineProperty(abc, "0", { value: false, writable: false });
`, "TypeError: Array.DefineOwnProperty Object.DefineOwnProperty failed")
// Test that a regular expression can contain \c0410 (CYRILLIC CAPITAL LETTER A)
// without panicking
test(`
var abc = 0x0410;
var def = String.fromCharCode(abc);
new RegExp("\\c" + def).exec(def);
`, "null")
// Test transforming a transformable regular expression without a panic
test(`
new RegExp("\\u0000");
new RegExp("\\undefined").test("undefined");
`, true)
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。