summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/object/__proto__-fn-name.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/object/__proto__-fn-name.js')
-rw-r--r--js/src/tests/test262/language/expressions/object/__proto__-fn-name.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/object/__proto__-fn-name.js b/js/src/tests/test262/language/expressions/object/__proto__-fn-name.js
new file mode 100644
index 0000000000..57a654afd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/object/__proto__-fn-name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es6id: B.3.1
+description: Function name is not assigned based on the property name
+info: |
+ [...]
+ 6. If propKey is the String value "__proto__" and if
+ IsComputedPropertyKey(propKey) is false, then
+ a. If Type(propValue) is either Object or Null, then
+ i. Return object.[[SetPrototypeOf]](propValue).
+ b. Return NormalCompletion(empty).
+ 7. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be HasOwnProperty(propValue, "name").
+ b. ReturnIfAbrupt(hasNameProperty).
+ c. If hasNameProperty is false, perform SetFunctionName(propValue, propKey).
+---*/
+
+var o;
+
+o = {
+ __proto__: function() {}
+};
+
+assert(o.__proto__.name !== '__proto__');
+
+reportCompare(0, 0);