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

Unified Diff: include/v8.h

Issue 1154233003: Introduce v8::Object::CreateDataProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 7 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 27e212d468f054878c5e04fd7e3c2d493d2a23a4..704086e7315d79e5e9d26124c560edf4e60bd951 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2592,6 +2592,20 @@ class V8_EXPORT Object : public Value {
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
Local<Value> value);
+ // Implements CreateDataProperty (ECMA-262, 7.3.4).
+ //
+ // Defines a configurable, writable, enumerable property with the given value
+ // on the object unless the property already exists and is not configurable
+ // or the object is not extensible.
+ //
+ // Returns true on success.
+ V8_WARN_UNUSED_RESULT Maybe<bool> CreateDataProperty(Local<Context> context,
+ Local<Name> key,
+ Local<Value> value);
+ V8_WARN_UNUSED_RESULT Maybe<bool> CreateDataProperty(Local<Context> context,
+ uint32_t index,
+ Local<Value> value);
+
// Sets an own property on this object bypassing interceptors and
// overriding accessors or read-only properties.
//
@@ -2600,12 +2614,13 @@ class V8_EXPORT Object : public Value {
// will only be returned if the interceptor doesn't return a value.
//
// Note also that this only works for named properties.
- V8_DEPRECATE_SOON("Use maybe version",
+ V8_DEPRECATE_SOON("Use CreateDataProperty",
bool ForceSet(Handle<Value> key, Handle<Value> value,
PropertyAttribute attribs = None));
- // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
- Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
- Local<Value> value, PropertyAttribute attribs = None);
+ V8_DEPRECATE_SOON("Use CreateDataProperty",
+ Maybe<bool> ForceSet(Local<Context> context,
+ Local<Value> key, Local<Value> value,
+ PropertyAttribute attribs = None));
V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Handle<Value> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698