Index: test/intl/break-iterator/protected-icu-internals.js |
diff --git a/test/mjsunit/regress/json-stringifier-emptyhandle.js b/test/intl/break-iterator/protected-icu-internals.js |
similarity index 73% |
copy from test/mjsunit/regress/json-stringifier-emptyhandle.js |
copy to test/intl/break-iterator/protected-icu-internals.js |
index 970b0b834cd47d5b480638d1a037e16de6d2b8a4..ad1dc54fbedf1f52687834bcbd1c64ee2a1dc4b1 100644 |
--- a/test/mjsunit/regress/json-stringifier-emptyhandle.js |
+++ b/test/intl/break-iterator/protected-icu-internals.js |
@@ -25,20 +25,25 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// Internal object we got from native code should not be writable, |
+// configurable or enumerable. One can still change its public properties, but |
+// we don't use them to do actual work. |
-function explode() { |
- var array = [1,2,3]; |
+var iterator = new Intl.v8BreakIterator([]); |
- Object.defineProperty(array, 4, { |
- get: function () { throw "dynamite"; }, |
- }); |
+// Direct write should fail. |
+iterator.iterator = {'zzz':'some random object'}; |
- JSON.stringify(array); |
-} |
+assertFalse(iterator.iterator.hasOwnProperty('zzz')); |
+// Try redefining the property. |
+var didThrow = false; |
try { |
- explode(); |
- assertUnreachable(); |
+ Object.defineProperty(iterator, 'iterator', {value: undefined}); |
} catch(e) { |
- assertEquals("dynamite", e); |
+ didThrow = true; |
} |
+assertTrue(didThrow); |
+ |
+// Try deleting the property. |
+assertFalse(delete iterator.iterator); |