Add test case for issue 2793 about experimental natives.

R=yangguo@chromium.org
BUG=v8:2793

Review URL: https://codereview.chromium.org/19948002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15810 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d6e54c5f
...@@ -288,6 +288,22 @@ assertEquals("WeakMap", WeakMap.name); ...@@ -288,6 +288,22 @@ assertEquals("WeakMap", WeakMap.name);
assertEquals("WeakSet", WeakSet.name); assertEquals("WeakSet", WeakSet.name);
// Test prototype property of Set, Map, WeakMap and WeakSet.
function TestPrototype(C) {
assertTrue(C.prototype instanceof Object);
assertEquals({
value: {},
writable: true, // TODO(2793): This should be non-writable.
enumerable: false,
configurable: false
}, Object.getOwnPropertyDescriptor(C, "prototype"));
}
TestPrototype(Set);
TestPrototype(Map);
TestPrototype(WeakMap);
TestPrototype(WeakSet);
// Test constructor property of the Set, Map, WeakMap and WeakSet prototype. // Test constructor property of the Set, Map, WeakMap and WeakSet prototype.
function TestConstructor(C) { function TestConstructor(C) {
assertFalse(C === Object.prototype.constructor); assertFalse(C === Object.prototype.constructor);
...@@ -301,6 +317,7 @@ TestConstructor(WeakMap); ...@@ -301,6 +317,7 @@ TestConstructor(WeakMap);
TestConstructor(WeakSet); TestConstructor(WeakSet);
// Test the Set, Map, WeakMap and WeakSet global properties themselves.
function TestDescriptor(global, C) { function TestDescriptor(global, C) {
assertEquals({ assertEquals({
value: C, value: C,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment