mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1283334 - Part 5: Do not sparsify dense arrays when freezing - Tests. r=jandem
--HG-- extra : rebase_source : 2f3fed3591809bba99a61b6f3f6242024122e2e5 extra : histedit_source : a3438c47c2c1fddefccd26e611e4705604684213
This commit is contained in:
parent
6e5839fc27
commit
9efe6c6dc7
16
js/src/jit-test/tests/basic/define-frozen-dense-strict.js
Normal file
16
js/src/jit-test/tests/basic/define-frozen-dense-strict.js
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
var t = [4];
|
||||
var stop;
|
||||
Object.freeze(t);
|
||||
do {
|
||||
let ok = false;
|
||||
stop = inIon();
|
||||
try {
|
||||
t[1] = 2;
|
||||
} catch(e) {
|
||||
ok = true;
|
||||
}
|
||||
assertEq(ok, true);
|
||||
assertEq(t.length, 1);
|
||||
assertEq(t[1], undefined);
|
||||
} while (!stop);
|
9
js/src/jit-test/tests/basic/define-frozen-dense.js
Normal file
9
js/src/jit-test/tests/basic/define-frozen-dense.js
Normal file
@ -0,0 +1,9 @@
|
||||
var t = [4];
|
||||
var stop;
|
||||
Object.freeze(t);
|
||||
do {
|
||||
stop = inIon();
|
||||
t[1] = 2;
|
||||
assertEq(t.length, 1);
|
||||
assertEq(t[1], undefined);
|
||||
} while (!stop);
|
14
js/src/jit-test/tests/basic/define-frozen-property-strict.js
Normal file
14
js/src/jit-test/tests/basic/define-frozen-property-strict.js
Normal file
@ -0,0 +1,14 @@
|
||||
function foo(x) {
|
||||
"use strict";
|
||||
var ok = false;
|
||||
try {
|
||||
x.c = 10;
|
||||
} catch(e) {
|
||||
ok = true;
|
||||
}
|
||||
assertEq(ok, true);
|
||||
assertEq(x.c, undefined);
|
||||
}
|
||||
x = {a:0,b:1};
|
||||
Object.freeze(x);
|
||||
foo(x);
|
7
js/src/jit-test/tests/basic/define-frozen-property.js
Normal file
7
js/src/jit-test/tests/basic/define-frozen-property.js
Normal file
@ -0,0 +1,7 @@
|
||||
function foo(x) {
|
||||
x.c = 10;
|
||||
assertEq(x.c, undefined);
|
||||
}
|
||||
x = {a:0,b:1};
|
||||
Object.freeze(x);
|
||||
foo(x);
|
@ -0,0 +1,20 @@
|
||||
// |jit-test| --no-threads; --ion-eager; --ion-shared-stubs=off
|
||||
setJitCompilerOption('ion.forceinlineCaches', 1);
|
||||
function foo(t) {
|
||||
"use strict";
|
||||
var stop;
|
||||
do {
|
||||
let ok = false;
|
||||
stop = inIon();
|
||||
try {
|
||||
t[0] = 2;
|
||||
} catch(e) {
|
||||
ok = true;
|
||||
}
|
||||
assertEq(ok, true);
|
||||
} while (!stop);
|
||||
}
|
||||
var t = [4];
|
||||
Object.freeze(t);
|
||||
foo(t);
|
||||
foo(t);
|
14
js/src/jit-test/tests/basic/write-frozen-dense-strict.js
Normal file
14
js/src/jit-test/tests/basic/write-frozen-dense-strict.js
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var t = [4];
|
||||
var stop;
|
||||
Object.freeze(t);
|
||||
do {
|
||||
let ok = false;
|
||||
stop = inIon();
|
||||
try {
|
||||
t[0] = 2;
|
||||
} catch(e) {
|
||||
ok = true;
|
||||
}
|
||||
assertEq(ok, true);
|
||||
} while (!stop);
|
8
js/src/jit-test/tests/basic/write-frozen-dense.js
Normal file
8
js/src/jit-test/tests/basic/write-frozen-dense.js
Normal file
@ -0,0 +1,8 @@
|
||||
var t = [4];
|
||||
var stop;
|
||||
Object.freeze(t);
|
||||
do {
|
||||
stop = inIon();
|
||||
t[0] = 2;
|
||||
assertEq(t[0], 4);
|
||||
} while (!stop);
|
14
js/src/jit-test/tests/basic/write-frozen-property-strict.js
Normal file
14
js/src/jit-test/tests/basic/write-frozen-property-strict.js
Normal file
@ -0,0 +1,14 @@
|
||||
function foo(x) {
|
||||
"use strict";
|
||||
var ok = false;
|
||||
try {
|
||||
x.a = 10;
|
||||
} catch(e) {
|
||||
ok = true;
|
||||
}
|
||||
assertEq(ok, true);
|
||||
assertEq(x.a, 0);
|
||||
}
|
||||
x = {a:0,b:1};
|
||||
Object.freeze(x);
|
||||
foo(x);
|
@ -1,4 +1,3 @@
|
||||
|
||||
function foo(x) {
|
||||
x.a = 10;
|
||||
assertEq(x.a, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user