summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/es7
diff options
context:
space:
mode:
authorChris Dickinson <christopher.s.dickinson@gmail.com>2015-05-05 13:48:55 -0700
committerRod Vagg <rod@vagg.org>2015-08-04 11:56:09 -0700
commitd58e780504bdba6c5897c48428fd984c5b5f96fe (patch)
tree033f1568ae3f9f077aceb843b42eb1ed1739ce0f /deps/v8/test/mjsunit/es7
parent21d31c08e7d0b6865e52452750b20b05e6dca443 (diff)
downloadandroid-node-v8-d58e780504bdba6c5897c48428fd984c5b5f96fe.tar.gz
android-node-v8-d58e780504bdba6c5897c48428fd984c5b5f96fe.tar.bz2
android-node-v8-d58e780504bdba6c5897c48428fd984c5b5f96fe.zip
deps: update v8 to 4.3.61.21
* @indutny's SealHandleScope patch (484bebc38319fc7c622478037922ad73b2edcbf9) has been cherry picked onto the top of V8 to make it compile. * There's some test breakage in contextify. * This was merged at the request of the TC. PR-URL: https://github.com/iojs/io.js/pull/1632
Diffstat (limited to 'deps/v8/test/mjsunit/es7')
-rw-r--r--deps/v8/test/mjsunit/es7/object-observe.js67
1 files changed, 66 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/es7/object-observe.js b/deps/v8/test/mjsunit/es7/object-observe.js
index 5af205eadf..b2853c4048 100644
--- a/deps/v8/test/mjsunit/es7/object-observe.js
+++ b/deps/v8/test/mjsunit/es7/object-observe.js
@@ -1142,7 +1142,9 @@ var properties = ["a", "1", 1, "length", "setPrototype", "name", "caller"];
function blacklisted(obj, prop) {
return (obj instanceof Int32Array && prop == 1) ||
(obj instanceof Int32Array && prop === "length") ||
- (obj instanceof ArrayBuffer && prop == 1)
+ (obj instanceof ArrayBuffer && prop == 1) ||
+ (obj instanceof Function && prop === "name") || // Has its own test.
+ (obj instanceof Function && prop === "length"); // Has its own test.
}
for (var i in objects) for (var j in properties) {
@@ -1798,3 +1800,66 @@ for (var b1 = 0; b1 < 2; ++b1)
for (var n = 0; n < 3; ++n)
for (var i in mutationByIncr)
TestFastElementsLength(mutationByIncr[i], b1 != 0, b2 != 0, 7*n, 7*n+1);
+
+
+(function TestFunctionName() {
+ reset();
+
+ function fun() {}
+ Object.observe(fun, observer.callback);
+ fun.name = 'x'; // No change. Not writable.
+ Object.defineProperty(fun, 'name', {value: 'a'});
+ Object.defineProperty(fun, 'name', {writable: true});
+ fun.name = 'b';
+ delete fun.name;
+ fun.name = 'x'; // No change. Function.prototype.name is non writable
+ Object.defineProperty(Function.prototype, 'name', {writable: true});
+ fun.name = 'c';
+ fun.name = 'c'; // Same, no update.
+ Object.deliverChangeRecords(observer.callback);
+ observer.assertCallbackRecords([
+ { object: fun, type: 'update', name: 'name', oldValue: 'fun' },
+ { object: fun, type: 'reconfigure', name: 'name'},
+ { object: fun, type: 'update', name: 'name', oldValue: 'a' },
+ { object: fun, type: 'delete', name: 'name', oldValue: 'b' },
+ { object: fun, type: 'add', name: 'name' },
+ ]);
+})();
+
+
+(function TestFunctionLength() {
+ reset();
+
+ function fun(x) {}
+ Object.observe(fun, observer.callback);
+ fun.length = 'x'; // No change. Not writable.
+ Object.defineProperty(fun, 'length', {value: 'a'});
+ Object.defineProperty(fun, 'length', {writable: true});
+ fun.length = 'b';
+ delete fun.length;
+ fun.length = 'x'; // No change. Function.prototype.length is non writable
+ Object.defineProperty(Function.prototype, 'length', {writable: true});
+ fun.length = 'c';
+ fun.length = 'c'; // Same, no update.
+ Object.deliverChangeRecords(observer.callback);
+ observer.assertCallbackRecords([
+ { object: fun, type: 'update', name: 'length', oldValue: 1 },
+ { object: fun, type: 'reconfigure', name: 'length'},
+ { object: fun, type: 'update', name: 'length', oldValue: 'a' },
+ { object: fun, type: 'delete', name: 'length', oldValue: 'b' },
+ { object: fun, type: 'add', name: 'length' },
+ ]);
+})();
+
+
+(function TestObserveInvalidAcceptMessage() {
+ var ex;
+ try {
+ Object.observe({}, function(){}, "not an object");
+ } catch (e) {
+ ex = e;
+ }
+ assertInstanceof(ex, TypeError);
+ assertEquals("Third argument to Object.observe must be an array of strings.",
+ ex.message);
+})()