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

Unified Diff: src/v8natives.js

Issue 1319133002: [es6] Implement spec compliant ToName (actually ToPropertyKey). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToPrimitive
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/mjsunit/harmony/to-name.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 7d8b78a6b2f4ee249510421725e05328a8de8159..4a9cf547187e1222eb74db2333fb0429a1708b9e 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -176,7 +176,7 @@ function ObjectValueOf() {
// ECMA-262 - 15.2.4.5
function ObjectHasOwnProperty(value) {
- var name = $toName(value);
+ var name = TO_NAME(value);
var object = TO_OBJECT(this);
if (%_IsJSProxy(object)) {
@@ -200,7 +200,7 @@ function ObjectIsPrototypeOf(V) {
// ECMA-262 - 15.2.4.6
function ObjectPropertyIsEnumerable(V) {
- var P = $toName(V);
+ var P = TO_NAME(V);
if (%_IsJSProxy(this)) {
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
if (IS_SYMBOL(V)) return false;
@@ -225,7 +225,7 @@ function ObjectDefineGetter(name, fun) {
desc.setGet(fun);
desc.setEnumerable(true);
desc.setConfigurable(true);
- DefineOwnProperty(TO_OBJECT(receiver), $toName(name), desc, false);
+ DefineOwnProperty(TO_OBJECT(receiver), TO_NAME(name), desc, false);
}
@@ -234,7 +234,7 @@ function ObjectLookupGetter(name) {
if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) {
receiver = %GlobalProxy(ObjectLookupGetter);
}
- return %LookupAccessor(TO_OBJECT(receiver), $toName(name), GETTER);
+ return %LookupAccessor(TO_OBJECT(receiver), TO_NAME(name), GETTER);
}
@@ -250,7 +250,7 @@ function ObjectDefineSetter(name, fun) {
desc.setSet(fun);
desc.setEnumerable(true);
desc.setConfigurable(true);
- DefineOwnProperty(TO_OBJECT(receiver), $toName(name), desc, false);
+ DefineOwnProperty(TO_OBJECT(receiver), TO_NAME(name), desc, false);
}
@@ -259,7 +259,7 @@ function ObjectLookupSetter(name) {
if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) {
receiver = %GlobalProxy(ObjectLookupSetter);
}
- return %LookupAccessor(TO_OBJECT(receiver), $toName(name), SETTER);
+ return %LookupAccessor(TO_OBJECT(receiver), TO_NAME(name), SETTER);
}
@@ -561,7 +561,7 @@ function CallTrap2(handler, name, defaultTrap, x, y) {
// ES5 section 8.12.1.
function GetOwnPropertyJS(obj, v) {
- var p = $toName(v);
+ var p = TO_NAME(v);
if (%_IsJSProxy(obj)) {
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
if (IS_SYMBOL(v)) return UNDEFINED;
@@ -632,7 +632,7 @@ function DefineProxyProperty(obj, p, attributes, should_throw) {
// ES5 8.12.9.
function DefineObjectProperty(obj, p, desc, should_throw) {
- var current_array = %GetOwnProperty(obj, $toName(p));
+ var current_array = %GetOwnProperty(obj, TO_NAME(p));
var current = ConvertDescriptorArrayToDescriptor(current_array);
var extensible = %IsExtensible(obj);
@@ -906,7 +906,7 @@ function ToNameArray(obj, trap, includeSymbols) {
var realLength = 0;
var names = { __proto__: null }; // TODO(rossberg): use sets once ready.
for (var index = 0; index < n; index++) {
- var s = $toName(obj[index]);
+ var s = TO_NAME(obj[index]);
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
if (IS_SYMBOL(s) && !includeSymbols) continue;
if (%HasOwnProperty(names, s)) {
@@ -1032,7 +1032,7 @@ function ObjectDefineProperty(obj, p, attributes) {
if (!IS_SPEC_OBJECT(obj)) {
throw MakeTypeError(kCalledOnNonObject, "Object.defineProperty");
}
- var name = $toName(p);
+ var name = TO_NAME(p);
if (%_IsJSProxy(obj)) {
// Clone the attributes object for protection.
// TODO(rossberg): not spec'ed yet, so not sure if this should involve
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/mjsunit/harmony/to-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698