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

Unified Diff: test/intl/collator/protected-icu-internals.js

Issue 230383002: Version 3.24.35.30 (rollback of r20375) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.24
Patch Set: Created 6 years, 8 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
Index: test/intl/collator/protected-icu-internals.js
diff --git a/test/mjsunit/regress/json-stringifier-emptyhandle.js b/test/intl/collator/protected-icu-internals.js
similarity index 73%
copy from test/mjsunit/regress/json-stringifier-emptyhandle.js
copy to test/intl/collator/protected-icu-internals.js
index 970b0b834cd47d5b480638d1a037e16de6d2b8a4..7acd35e45464bd248b0fc7fa54b83c27588a127c 100644
--- a/test/mjsunit/regress/json-stringifier-emptyhandle.js
+++ b/test/intl/collator/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 collator = new Intl.Collator([]);
- Object.defineProperty(array, 4, {
- get: function () { throw "dynamite"; },
- });
+// Direct write should fail.
+collator.collator = {'zzz':'some random object'};
- JSON.stringify(array);
-}
+assertFalse(collator.collator.hasOwnProperty('zzz'));
+// Try redefining the property.
+var didThrow = false;
try {
- explode();
- assertUnreachable();
+ Object.defineProperty(collator, 'collator', {value: undefined});
} catch(e) {
- assertEquals("dynamite", e);
+ didThrow = true;
}
+assertTrue(didThrow);
+
+// Try deleting the property.
+assertFalse(delete collator.collator);
« no previous file with comments | « test/intl/break-iterator/protected-icu-internals.js ('k') | test/intl/date-format/protected-icu-internals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698