summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/strict-mode.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-06-19 13:23:56 +0200
committerRod Vagg <rod@vagg.org>2015-08-04 11:56:14 -0700
commit70d1f32f5605465a1a630a64f6f0d35f96c7709d (patch)
tree0a349040a686eafcb0a09943ebc733477dce2781 /deps/v8/test/mjsunit/strict-mode.js
parent4643b8b6671607a7aff60cbbd0b384dcf2f6959e (diff)
downloadandroid-node-v8-70d1f32f5605465a1a630a64f6f0d35f96c7709d.tar.gz
android-node-v8-70d1f32f5605465a1a630a64f6f0d35f96c7709d.tar.bz2
android-node-v8-70d1f32f5605465a1a630a64f6f0d35f96c7709d.zip
deps: update v8 to 4.4.63.9
Upgrade the bundled V8 and update code in src/ and lib/ to the new API. Notable backwards incompatible changes are the removal of the smalloc module and dropped support for CESU-8 decoding. CESU-8 support can be brought back if necessary by doing UTF-8 decoding ourselves. This commit includes https://codereview.chromium.org/1192973004 to fix a build error on python 2.6 systems. The original commit log follows: Use optparse in js2c.py for python compatibility Without this change, V8 won't build on RHEL/CentOS 6 because the distro python is too old to know about the argparse module. PR-URL: https://github.com/nodejs/io.js/pull/2022 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/v8/test/mjsunit/strict-mode.js')
-rw-r--r--deps/v8/test/mjsunit/strict-mode.js58
1 files changed, 43 insertions, 15 deletions
diff --git a/deps/v8/test/mjsunit/strict-mode.js b/deps/v8/test/mjsunit/strict-mode.js
index c97429f7b7..326e725774 100644
--- a/deps/v8/test/mjsunit/strict-mode.js
+++ b/deps/v8/test/mjsunit/strict-mode.js
@@ -1010,7 +1010,35 @@ repeat(10, function() {
})();
-function CheckPillDescriptor(func, name) {
+function CheckFunctionPillDescriptor(func, name) {
+
+ function CheckPill(pill) {
+ assertEquals("function", typeof pill);
+ assertInstanceof(pill, Function);
+ pill.property = "value";
+ assertEquals(pill.value, undefined);
+ assertThrows(function() { 'use strict'; pill.property = "value"; },
+ TypeError);
+ assertThrows(pill, TypeError);
+ assertEquals(pill.prototype, (function(){}).prototype);
+ var d = Object.getOwnPropertyDescriptor(pill, "prototype");
+ assertFalse(d.writable);
+ assertFalse(d.configurable);
+ assertFalse(d.enumerable);
+ }
+
+ // Poisoned accessors are no longer own properties
+ func = Object.getPrototypeOf(func);
+ var descriptor = Object.getOwnPropertyDescriptor(func, name);
+ CheckPill(descriptor.get)
+ CheckPill(descriptor.set);
+ assertFalse(descriptor.enumerable);
+ // In ES6, restricted function properties are configurable
+ assertTrue(descriptor.configurable);
+}
+
+
+function CheckArgumentsPillDescriptor(func, name) {
function CheckPill(pill) {
assertEquals("function", typeof pill);
@@ -1056,12 +1084,12 @@ function CheckPillDescriptor(func, name) {
assertThrows(function() { third.caller = 42; }, TypeError);
assertThrows(function() { third.arguments = 42; }, TypeError);
- CheckPillDescriptor(strict, "caller");
- CheckPillDescriptor(strict, "arguments");
- CheckPillDescriptor(another, "caller");
- CheckPillDescriptor(another, "arguments");
- CheckPillDescriptor(third, "caller");
- CheckPillDescriptor(third, "arguments");
+ CheckFunctionPillDescriptor(strict, "caller");
+ CheckFunctionPillDescriptor(strict, "arguments");
+ CheckFunctionPillDescriptor(another, "caller");
+ CheckFunctionPillDescriptor(another, "arguments");
+ CheckFunctionPillDescriptor(third, "caller");
+ CheckFunctionPillDescriptor(third, "arguments");
})();
@@ -1093,15 +1121,15 @@ function CheckPillDescriptor(func, name) {
}
var args = strict();
- CheckPillDescriptor(args, "caller");
- CheckPillDescriptor(args, "callee");
+ CheckArgumentsPillDescriptor(args, "caller");
+ CheckArgumentsPillDescriptor(args, "callee");
args = strict(17, "value", strict);
assertEquals(17, args[0])
assertEquals("value", args[1])
assertEquals(strict, args[2]);
- CheckPillDescriptor(args, "caller");
- CheckPillDescriptor(args, "callee");
+ CheckArgumentsPillDescriptor(args, "caller");
+ CheckArgumentsPillDescriptor(args, "callee");
function outer() {
"use strict";
@@ -1112,15 +1140,15 @@ function CheckPillDescriptor(func, name) {
}
var args = outer()();
- CheckPillDescriptor(args, "caller");
- CheckPillDescriptor(args, "callee");
+ CheckArgumentsPillDescriptor(args, "caller");
+ CheckArgumentsPillDescriptor(args, "callee");
args = outer()(17, "value", strict);
assertEquals(17, args[0])
assertEquals("value", args[1])
assertEquals(strict, args[2]);
- CheckPillDescriptor(args, "caller");
- CheckPillDescriptor(args, "callee");
+ CheckArgumentsPillDescriptor(args, "caller");
+ CheckArgumentsPillDescriptor(args, "callee");
})();