nashorn/test/script/basic/JDK-8035312.js.EXPECTED
author martin
Wed, 10 Dec 2014 09:23:00 -0800
changeset 28057 1a47ceecdba5
parent 27525 e7d3c00b9fb8
child 47205 6ddad446ba23
permissions -rw-r--r--
8065804: JEP 171: Clarifications/corrections for fence intrinsics Reviewed-by: dholmes, shade, dl, psandoz

*** Freezing

>>> Push test
Pushing 0 to 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
x.length === 3 (should be 3)
x[3] === undefined (should be 0)
x[4] === undefined (should be undefined)

>>> Pop test
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
x.length === 3 (should be 3)
x === 1,2,3
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter
x.length === 3 (should be 3)
x === 1,2,3
class jdk.nashorn.internal.runtime.arrays.FrozenArrayFilter

*** Other length not writable issues

>>> Push test
Pushing 0 to 1,2,3
caught errorTypeError: "length" is not a writable property of [object Array]
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
x.length === 3 (should be 3)
x[3] === 0 (should be 0)
x[4] === undefined (should be undefined)

>>> Pop test
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
x.length === 3 (should be 3)
x === 1,2,3
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Popping from 1,2,3
	array is now [1,2,3] length is = 3

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
x.length === 3 (should be 3)
x === 1,2,3
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 0
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 1
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 2
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter

array writing 0-3, with 1 stride, array = 0
length = 1, but elements are: 0 undefined 2

initial length = 1
Writing 0
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 3
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 6
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 9
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 12
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 15
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 18
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 21
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 24
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
Writing 27
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter

array writing 0-20, with 3 stride, array = 0
length = 1, but elements are: 0 undefined undefined
0 has length 1

class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter
adding a new element high up in the array
length before element was added 1
putting sparse at 2147483637
length after element was added 1 should be the same
class jdk.nashorn.internal.runtime.arrays.LengthNotWritableFilter

Printing arr2 - this will fail if length is > 28 and it is 1
arr2 = [0]
new length that should not be writable = 1
true
sparse
0
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
0:0
2147483637:sparse
Checking if push works for bulkable non bulkable arrays - Setting length property not allowed
1 should be 1
bar should be bar
[bar] should be [bar]
1 should STILL be 1
bar should be bar
baz should be baz
[bar] should be [bar]

Checking if push works for bulkable non bulkable arrays - Setting length property not allowed
1 should be 1
bar should be bar
[bar] should be [bar]
got TypeError when redefining length, as expected

Checking if push works for bulkable non bulkable arrays - Setting length property not allowed
1 should be 1
bar should be bar
[bar] should be [bar]
2 should be 2
bar should be bar
baz should be baz
[bar,baz] should be [bar,baz]
Done