| Index: include/v8.h
|
| diff --git a/include/v8.h b/include/v8.h
|
| index d7b7205ef0a0b18e341343875f614ca18fed6610..5f0d367e6b6aaab723fef16197e13ba6875e1970 100644
|
| --- a/include/v8.h
|
| +++ b/include/v8.h
|
| @@ -302,6 +302,7 @@ class Local {
|
| template<class F1, class F2> friend class PersistentValueVector;
|
| template <class F>
|
| friend class ReturnValue;
|
| + friend class DictionarySchema;
|
|
|
| explicit V8_INLINE Local(T* that) : val_(that) {}
|
| V8_INLINE static Local<T> New(Isolate* isolate, T* that);
|
| @@ -5581,6 +5582,38 @@ class V8_EXPORT AccessorSignature : public Data {
|
| AccessorSignature();
|
| };
|
|
|
| +// --- Dictionary schema ---
|
| +
|
| +/*
|
| + * A DictionarySchema defines the keys expected to be present on a dictionary
|
| + * object and provides an efficient way of reading them.
|
| + */
|
| +class V8_EXPORT DictionarySchema : public Data {
|
| + public:
|
| + static Local<DictionarySchema> New(Isolate* isolate, Local<Value> keys[],
|
| + int keyCount);
|
| +
|
| + enum ValueFilter {
|
| + kValueFilterNone = 0,
|
| + kValueFilterPrimitives = 1 << 0,
|
| + kValueFilterObjects = 1 << 1,
|
| + };
|
| +
|
| + /*
|
| + * Reads keys from the object according to the schema, in order.
|
| + * Reading will abort if:
|
| + * - an exception is thrown (Nothing<bool>() is returned)
|
| + * - an object that doesn't match |continue_filter| is reached
|
| + * (Just(false) is returned)
|
| + * - all properties are read (Just(true) is returned)
|
| + *
|
| + * |index| will be updated to point to the next index left to be read;
|
| + * this makes repeated invocations convenient.
|
| + */
|
| + Maybe<bool> Get(Local<Context> context, Local<Object> object,
|
| + ValueFilter continue_filter, Local<Value>* out_values,
|
| + int out_length, int* index);
|
| +};
|
|
|
| // --- Extensions ---
|
|
|
|
|