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, |