Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: test/mjsunit/es6/typedarray.js

Issue 1232843005: Test that TypedArray properties cannot be set in strict mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test nonconfigurable integer indexed properties Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/typedarray.js
diff --git a/test/mjsunit/es6/typedarray.js b/test/mjsunit/es6/typedarray.js
index ef7955ce928bfd80deff04bea4ef71f2ad8395cc..7b1cc06e1ce446f06bc0e0c74786c5d6179d0e5d 100644
--- a/test/mjsunit/es6/typedarray.js
+++ b/test/mjsunit/es6/typedarray.js
@@ -417,6 +417,7 @@ var typedArrayConstructors = [
function TestPropertyTypeChecks(constructor) {
function CheckProperty(name) {
+ assertThrows(function() { 'use strict'; new constructor(10)[name] = 0; })
var d = Object.getOwnPropertyDescriptor(constructor.prototype, name);
adamk 2015/07/16 22:24:22 You can also test this more directly: assertEqual
Dan Ehrenberg 2015/07/16 23:54:55 Acknowledged.
var o = {};
assertThrows(function() {d.get.call(o);}, TypeError);
@@ -756,3 +757,13 @@ TestArbitrary(new DataView(new ArrayBuffer(256)));
// Test direct constructor call
assertThrows(function() { ArrayBuffer(); }, TypeError);
assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError);
+
+function TestNonConfigurableProperties(constructor) {
+ var arr = new constructor([100])
+ assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable)
+ assertFalse(delete arr[0])
+}
+
+for(i = 0; i < typedArrayConstructors.length; i++) {
+ TestNonConfigurableProperties(typedArrayConstructors[i]);
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698