libv8 4.5.95.5-amd64-freebsd-10 → 5.0.71.48.1beta2-amd64-freebsd-10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  #ifndef V8_V8_TEST_H_
6
6
  #define V8_V8_TEST_H_
7
7
 
8
- #include "v8.h"
8
+ #include "v8.h" // NOLINT(build/include)
9
9
 
10
10
  /**
11
11
  * Testing support for the V8 JavaScript engine.
@@ -39,7 +39,7 @@ class V8_EXPORT Testing {
39
39
  /**
40
40
  * Force deoptimization of all functions.
41
41
  */
42
- static void DeoptimizeAll();
42
+ static void DeoptimizeAll(Isolate* isolate);
43
43
  };
44
44
 
45
45
 
@@ -5,7 +5,7 @@
5
5
  #ifndef V8_UTIL_H_
6
6
  #define V8_UTIL_H_
7
7
 
8
- #include "v8.h"
8
+ #include "v8.h" // NOLINT(build/include)
9
9
  #include <map>
10
10
  #include <vector>
11
11
 
@@ -133,6 +133,8 @@ class DefaultGlobalMapTraits : public StdMapTraits<K, V> {
133
133
  return K();
134
134
  }
135
135
  static void DisposeCallbackData(WeakCallbackDataType* data) {}
136
+ static void OnWeakCallback(
137
+ const WeakCallbackInfo<WeakCallbackDataType>& data) {}
136
138
  static void Dispose(Isolate* isolate, Global<V> value, K key) {}
137
139
  // This is a second pass callback, so SetSecondPassCallback cannot be called.
138
140
  static void DisposeWeak(const WeakCallbackInfo<WeakCallbackDataType>& data) {}
@@ -452,7 +454,7 @@ class GlobalValueMap : public PersistentValueMapBase<K, V, Traits> {
452
454
  : WeakCallbackType::kParameter;
453
455
  Local<V> value(Local<V>::New(this->isolate(), *persistent));
454
456
  persistent->template SetWeak<typename Traits::WeakCallbackDataType>(
455
- Traits::WeakCallbackParameter(this, key, value), FirstWeakCallback,
457
+ Traits::WeakCallbackParameter(this, key, value), OnWeakCallback,
456
458
  callback_type);
457
459
  }
458
460
  PersistentContainerValue old_value =
@@ -471,12 +473,13 @@ class GlobalValueMap : public PersistentValueMapBase<K, V, Traits> {
471
473
  }
472
474
 
473
475
  private:
474
- static void FirstWeakCallback(
476
+ static void OnWeakCallback(
475
477
  const WeakCallbackInfo<typename Traits::WeakCallbackDataType>& data) {
476
478
  if (Traits::kCallbackType != kNotWeak) {
477
479
  auto map = Traits::MapFromWeakCallbackInfo(data);
478
480
  K key = Traits::KeyFromWeakCallbackInfo(data);
479
481
  map->RemoveWeak(key);
482
+ Traits::OnWeakCallback(data);
480
483
  data.SetSecondPassCallback(SecondWeakCallback);
481
484
  }
482
485
  }
@@ -8,10 +8,10 @@
8
8
  // These macros define the version number for the current version.
9
9
  // NOTE these macros are used by some of the tool scripts and the build
10
10
  // system so their names cannot be changed without changing the scripts.
11
- #define V8_MAJOR_VERSION 4
12
- #define V8_MINOR_VERSION 5
13
- #define V8_BUILD_NUMBER 95
14
- #define V8_PATCH_LEVEL 0
11
+ #define V8_MAJOR_VERSION 5
12
+ #define V8_MINOR_VERSION 0
13
+ #define V8_BUILD_NUMBER 71
14
+ #define V8_PATCH_LEVEL 48
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -12,15 +12,15 @@
12
12
  * For other documentation see http://code.google.com/apis/v8/
13
13
  */
14
14
 
15
- #ifndef V8_H_
16
- #define V8_H_
15
+ #ifndef INCLUDE_V8_H_
16
+ #define INCLUDE_V8_H_
17
17
 
18
18
  #include <stddef.h>
19
19
  #include <stdint.h>
20
20
  #include <stdio.h>
21
21
 
22
- #include "v8-version.h"
23
- #include "v8config.h"
22
+ #include "v8-version.h" // NOLINT(build/include)
23
+ #include "v8config.h" // NOLINT(build/include)
24
24
 
25
25
  // We reserve the V8_* prefix for macros defined in V8 public API and
26
26
  // assume there are no name conflicts with the embedder's code.
@@ -92,6 +92,7 @@ class ObjectTemplate;
92
92
  class Platform;
93
93
  class Primitive;
94
94
  class Promise;
95
+ class Proxy;
95
96
  class RawOperationDescriptor;
96
97
  class Script;
97
98
  class SharedArrayBuffer;
@@ -103,6 +104,7 @@ class String;
103
104
  class StringObject;
104
105
  class Symbol;
105
106
  class SymbolObject;
107
+ class Private;
106
108
  class Uint32;
107
109
  class Utils;
108
110
  class Value;
@@ -112,8 +114,8 @@ class MaybeLocal;
112
114
  template <class T> class Eternal;
113
115
  template<class T> class NonCopyablePersistentTraits;
114
116
  template<class T> class PersistentBase;
115
- template<class T,
116
- class M = NonCopyablePersistentTraits<T> > class Persistent;
117
+ template <class T, class M = NonCopyablePersistentTraits<T> >
118
+ class Persistent;
117
119
  template <class T>
118
120
  class Global;
119
121
  template<class K, class V, class T> class PersistentValueMap;
@@ -135,6 +137,10 @@ class CallHandlerHelper;
135
137
  class EscapableHandleScope;
136
138
  template<typename T> class ReturnValue;
137
139
 
140
+ namespace experimental {
141
+ class FastAccessorBuilder;
142
+ } // namespace experimental
143
+
138
144
  namespace internal {
139
145
  class Arguments;
140
146
  class Heap;
@@ -146,7 +152,7 @@ template<typename T> class CustomArguments;
146
152
  class PropertyCallbackArguments;
147
153
  class FunctionCallbackArguments;
148
154
  class GlobalHandles;
149
- }
155
+ } // namespace internal
150
156
 
151
157
 
152
158
  /**
@@ -215,8 +221,8 @@ class Local {
215
221
  : val_(reinterpret_cast<T*>(*that)) {
216
222
  /**
217
223
  * This check fails when trying to convert between incompatible
218
- * handles. For example, converting from a Handle<String> to a
219
- * Handle<Number>.
224
+ * handles. For example, converting from a Local<String> to a
225
+ * Local<Number>.
220
226
  */
221
227
  TYPE_CHECK(T, S);
222
228
  }
@@ -311,6 +317,7 @@ class Local {
311
317
  friend class String;
312
318
  friend class Object;
313
319
  friend class Context;
320
+ friend class Private;
314
321
  template<class F> friend class internal::CustomArguments;
315
322
  friend Local<Primitive> Undefined(Isolate* isolate);
316
323
  friend Local<Primitive> Null(Isolate* isolate);
@@ -322,17 +329,17 @@ class Local {
322
329
  friend class PersistentValueMapBase;
323
330
  template<class F1, class F2> friend class PersistentValueVector;
324
331
 
325
- template <class S>
326
- V8_INLINE Local(S* that)
327
- : val_(that) {}
332
+ explicit V8_INLINE Local(T* that) : val_(that) {}
328
333
  V8_INLINE static Local<T> New(Isolate* isolate, T* that);
329
334
  T* val_;
330
335
  };
331
336
 
332
337
 
333
- // Handle is an alias for Local for historical reasons.
338
+ #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
339
+ // Local is an alias for Local for historical reasons.
334
340
  template <class T>
335
341
  using Handle = Local<T>;
342
+ #endif
336
343
 
337
344
 
338
345
  /**
@@ -416,16 +423,19 @@ class WeakCallbackInfo {
416
423
  V8_INLINE T* GetParameter() const { return parameter_; }
417
424
  V8_INLINE void* GetInternalField(int index) const;
418
425
 
419
- V8_INLINE V8_DEPRECATE_SOON("use indexed version",
420
- void* GetInternalField1() const) {
426
+ V8_INLINE V8_DEPRECATED("use indexed version",
427
+ void* GetInternalField1() const) {
421
428
  return internal_fields_[0];
422
429
  }
423
- V8_INLINE V8_DEPRECATE_SOON("use indexed version",
424
- void* GetInternalField2() const) {
430
+ V8_INLINE V8_DEPRECATED("use indexed version",
431
+ void* GetInternalField2() const) {
425
432
  return internal_fields_[1];
426
433
  }
427
434
 
428
- bool IsFirstPass() const { return callback_ != nullptr; }
435
+ V8_DEPRECATED("Not realiable once SetSecondPassCallback() was used.",
436
+ bool IsFirstPass() const) {
437
+ return callback_ != nullptr;
438
+ }
429
439
 
430
440
  // When first called, the embedder MUST Reset() the Global which triggered the
431
441
  // callback. The Global itself is unusable for anything else. No v8 other api
@@ -495,7 +505,7 @@ template <class T> class PersistentBase {
495
505
  * and create a new one with the contents of other if other is non empty
496
506
  */
497
507
  template <class S>
498
- V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other);
508
+ V8_INLINE void Reset(Isolate* isolate, const Local<S>& other);
499
509
 
500
510
  /**
501
511
  * If non-empty, destroy the underlying storage cell
@@ -507,6 +517,10 @@ template <class T> class PersistentBase {
507
517
  V8_INLINE bool IsEmpty() const { return val_ == NULL; }
508
518
  V8_INLINE void Empty() { val_ = 0; }
509
519
 
520
+ V8_INLINE Local<T> Get(Isolate* isolate) const {
521
+ return Local<T>::New(isolate, *this);
522
+ }
523
+
510
524
  template <class S>
511
525
  V8_INLINE bool operator==(const PersistentBase<S>& that) const {
512
526
  internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
@@ -516,7 +530,8 @@ template <class T> class PersistentBase {
516
530
  return *a == *b;
517
531
  }
518
532
 
519
- template <class S> V8_INLINE bool operator==(const Handle<S>& that) const {
533
+ template <class S>
534
+ V8_INLINE bool operator==(const Local<S>& that) const {
520
535
  internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
521
536
  internal::Object** b = reinterpret_cast<internal::Object**>(that.val_);
522
537
  if (a == NULL) return b == NULL;
@@ -529,7 +544,8 @@ template <class T> class PersistentBase {
529
544
  return !operator==(that);
530
545
  }
531
546
 
532
- template <class S> V8_INLINE bool operator!=(const Handle<S>& that) const {
547
+ template <class S>
548
+ V8_INLINE bool operator!=(const Local<S>& that) const {
533
549
  return !operator==(that);
534
550
  }
535
551
 
@@ -541,13 +557,13 @@ template <class T> class PersistentBase {
541
557
  * critical form of resource management!
542
558
  */
543
559
  template <typename P>
544
- V8_INLINE V8_DEPRECATE_SOON(
560
+ V8_INLINE V8_DEPRECATED(
545
561
  "use WeakCallbackInfo version",
546
562
  void SetWeak(P* parameter,
547
563
  typename WeakCallbackData<T, P>::Callback callback));
548
564
 
549
565
  template <typename S, typename P>
550
- V8_INLINE V8_DEPRECATE_SOON(
566
+ V8_INLINE V8_DEPRECATED(
551
567
  "use WeakCallbackInfo version",
552
568
  void SetWeak(P* parameter,
553
569
  typename WeakCallbackData<S, P>::Callback callback));
@@ -559,7 +575,7 @@ template <class T> class PersistentBase {
559
575
  // specify a parameter for the callback or the location of two internal
560
576
  // fields in the dying object.
561
577
  template <typename P>
562
- V8_INLINE V8_DEPRECATE_SOON(
578
+ V8_INLINE V8_DEPRECATED(
563
579
  "use SetWeak",
564
580
  void SetPhantom(P* parameter,
565
581
  typename WeakCallbackInfo<P>::Callback callback,
@@ -595,6 +611,13 @@ template <class T> class PersistentBase {
595
611
  */
596
612
  V8_INLINE void MarkPartiallyDependent();
597
613
 
614
+ /**
615
+ * Marks the reference to this object as active. The scavenge garbage
616
+ * collection should not reclaim the objects marked as active.
617
+ * This bit is cleared after the each garbage collection pass.
618
+ */
619
+ V8_INLINE void MarkActive();
620
+
598
621
  V8_INLINE bool IsIndependent() const;
599
622
 
600
623
  /** Checks if the handle holds the only reference to an object. */
@@ -630,8 +653,8 @@ template <class T> class PersistentBase {
630
653
  friend class Object;
631
654
 
632
655
  explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
633
- PersistentBase(PersistentBase& other) = delete; // NOLINT
634
- void operator=(PersistentBase&) = delete;
656
+ PersistentBase(const PersistentBase& other) = delete; // NOLINT
657
+ void operator=(const PersistentBase&) = delete;
635
658
  V8_INLINE static T* New(Isolate* isolate, T* that);
636
659
 
637
660
  T* val_;
@@ -692,11 +715,12 @@ template <class T, class M> class Persistent : public PersistentBase<T> {
692
715
  */
693
716
  V8_INLINE Persistent() : PersistentBase<T>(0) { }
694
717
  /**
695
- * Construct a Persistent from a Handle.
696
- * When the Handle is non-empty, a new storage cell is created
718
+ * Construct a Persistent from a Local.
719
+ * When the Local is non-empty, a new storage cell is created
697
720
  * pointing to the same object, and no flags are set.
698
721
  */
699
- template <class S> V8_INLINE Persistent(Isolate* isolate, Handle<S> that)
722
+ template <class S>
723
+ V8_INLINE Persistent(Isolate* isolate, Local<S> that)
700
724
  : PersistentBase<T>(PersistentBase<T>::New(isolate, *that)) {
701
725
  TYPE_CHECK(T, S);
702
726
  }
@@ -764,7 +788,7 @@ template <class T, class M> class Persistent : public PersistentBase<T> {
764
788
  template<class F1, class F2> friend class Persistent;
765
789
  template<class F> friend class ReturnValue;
766
790
 
767
- template <class S> V8_INLINE Persistent(S* that) : PersistentBase<T>(that) { }
791
+ explicit V8_INLINE Persistent(T* that) : PersistentBase<T>(that) {}
768
792
  V8_INLINE T* operator*() const { return this->val_; }
769
793
  template<class S, class M2>
770
794
  V8_INLINE void Copy(const Persistent<S, M2>& that);
@@ -784,12 +808,12 @@ class Global : public PersistentBase<T> {
784
808
  */
785
809
  V8_INLINE Global() : PersistentBase<T>(nullptr) {}
786
810
  /**
787
- * Construct a Global from a Handle.
788
- * When the Handle is non-empty, a new storage cell is created
811
+ * Construct a Global from a Local.
812
+ * When the Local is non-empty, a new storage cell is created
789
813
  * pointing to the same object, and no flags are set.
790
814
  */
791
815
  template <class S>
792
- V8_INLINE Global(Isolate* isolate, Handle<S> that)
816
+ V8_INLINE Global(Isolate* isolate, Local<S> that)
793
817
  : PersistentBase<T>(PersistentBase<T>::New(isolate, *that)) {
794
818
  TYPE_CHECK(T, S);
795
819
  }
@@ -806,7 +830,7 @@ class Global : public PersistentBase<T> {
806
830
  /**
807
831
  * Move constructor.
808
832
  */
809
- V8_INLINE Global(Global&& other) : PersistentBase<T>(other.val_) {
833
+ V8_INLINE Global(Global&& other) : PersistentBase<T>(other.val_) { // NOLINT
810
834
  other.val_ = nullptr;
811
835
  }
812
836
  V8_INLINE ~Global() { this->Reset(); }
@@ -814,7 +838,7 @@ class Global : public PersistentBase<T> {
814
838
  * Move via assignment.
815
839
  */
816
840
  template <class S>
817
- V8_INLINE Global& operator=(Global<S>&& rhs) {
841
+ V8_INLINE Global& operator=(Global<S>&& rhs) { // NOLINT
818
842
  TYPE_CHECK(T, S);
819
843
  if (this != &rhs) {
820
844
  this->Reset();
@@ -826,7 +850,7 @@ class Global : public PersistentBase<T> {
826
850
  /**
827
851
  * Pass allows returning uniques from functions, etc.
828
852
  */
829
- Global Pass() { return static_cast<Global&&>(*this); }
853
+ Global Pass() { return static_cast<Global&&>(*this); } // NOLINT
830
854
 
831
855
  /*
832
856
  * For compatibility with Chromium's base::Bind (base::Passed).
@@ -836,8 +860,8 @@ class Global : public PersistentBase<T> {
836
860
  private:
837
861
  template <class F>
838
862
  friend class ReturnValue;
839
- Global(Global&) = delete;
840
- void operator=(Global&) = delete;
863
+ Global(const Global&) = delete;
864
+ void operator=(const Global&) = delete;
841
865
  V8_INLINE T* operator*() const { return this->val_; }
842
866
  };
843
867
 
@@ -863,7 +887,7 @@ using UniquePersistent = Global<T>;
863
887
  */
864
888
  class V8_EXPORT HandleScope {
865
889
  public:
866
- HandleScope(Isolate* isolate);
890
+ explicit HandleScope(Isolate* isolate);
867
891
 
868
892
  ~HandleScope();
869
893
 
@@ -916,7 +940,7 @@ class V8_EXPORT HandleScope {
916
940
  */
917
941
  class V8_EXPORT EscapableHandleScope : public HandleScope {
918
942
  public:
919
- EscapableHandleScope(Isolate* isolate);
943
+ explicit EscapableHandleScope(Isolate* isolate);
920
944
  V8_INLINE ~EscapableHandleScope() {}
921
945
 
922
946
  /**
@@ -957,8 +981,8 @@ class V8_EXPORT SealHandleScope {
957
981
  void operator delete(void*, size_t);
958
982
 
959
983
  internal::Isolate* isolate_;
960
- int prev_level_;
961
984
  internal::Object** prev_limit_;
985
+ int prev_sealed_level_;
962
986
  };
963
987
 
964
988
 
@@ -1012,31 +1036,31 @@ class ScriptOriginOptions {
1012
1036
  class ScriptOrigin {
1013
1037
  public:
1014
1038
  V8_INLINE ScriptOrigin(
1015
- Handle<Value> resource_name,
1016
- Handle<Integer> resource_line_offset = Handle<Integer>(),
1017
- Handle<Integer> resource_column_offset = Handle<Integer>(),
1018
- Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>(),
1019
- Handle<Integer> script_id = Handle<Integer>(),
1020
- Handle<Boolean> resource_is_embedder_debug_script = Handle<Boolean>(),
1021
- Handle<Value> source_map_url = Handle<Value>(),
1022
- Handle<Boolean> resource_is_opaque = Handle<Boolean>());
1023
- V8_INLINE Handle<Value> ResourceName() const;
1024
- V8_INLINE Handle<Integer> ResourceLineOffset() const;
1025
- V8_INLINE Handle<Integer> ResourceColumnOffset() const;
1039
+ Local<Value> resource_name,
1040
+ Local<Integer> resource_line_offset = Local<Integer>(),
1041
+ Local<Integer> resource_column_offset = Local<Integer>(),
1042
+ Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
1043
+ Local<Integer> script_id = Local<Integer>(),
1044
+ Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(),
1045
+ Local<Value> source_map_url = Local<Value>(),
1046
+ Local<Boolean> resource_is_opaque = Local<Boolean>());
1047
+ V8_INLINE Local<Value> ResourceName() const;
1048
+ V8_INLINE Local<Integer> ResourceLineOffset() const;
1049
+ V8_INLINE Local<Integer> ResourceColumnOffset() const;
1026
1050
  /**
1027
1051
  * Returns true for embedder's debugger scripts
1028
1052
  */
1029
- V8_INLINE Handle<Integer> ScriptID() const;
1030
- V8_INLINE Handle<Value> SourceMapUrl() const;
1053
+ V8_INLINE Local<Integer> ScriptID() const;
1054
+ V8_INLINE Local<Value> SourceMapUrl() const;
1031
1055
  V8_INLINE ScriptOriginOptions Options() const { return options_; }
1032
1056
 
1033
1057
  private:
1034
- Handle<Value> resource_name_;
1035
- Handle<Integer> resource_line_offset_;
1036
- Handle<Integer> resource_column_offset_;
1058
+ Local<Value> resource_name_;
1059
+ Local<Integer> resource_line_offset_;
1060
+ Local<Integer> resource_column_offset_;
1037
1061
  ScriptOriginOptions options_;
1038
- Handle<Integer> script_id_;
1039
- Handle<Value> source_map_url_;
1062
+ Local<Integer> script_id_;
1063
+ Local<Value> source_map_url_;
1040
1064
  };
1041
1065
 
1042
1066
 
@@ -1051,16 +1075,16 @@ class V8_EXPORT UnboundScript {
1051
1075
  Local<Script> BindToCurrentContext();
1052
1076
 
1053
1077
  int GetId();
1054
- Handle<Value> GetScriptName();
1078
+ Local<Value> GetScriptName();
1055
1079
 
1056
1080
  /**
1057
1081
  * Data read from magic sourceURL comments.
1058
1082
  */
1059
- Handle<Value> GetSourceURL();
1083
+ Local<Value> GetSourceURL();
1060
1084
  /**
1061
1085
  * Data read from magic sourceMappingURL comments.
1062
1086
  */
1063
- Handle<Value> GetSourceMappingURL();
1087
+ Local<Value> GetSourceMappingURL();
1064
1088
 
1065
1089
  /**
1066
1090
  * Returns zero based line number of the code_pos location in the script.
@@ -1083,15 +1107,15 @@ class V8_EXPORT Script {
1083
1107
  */
1084
1108
  static V8_DEPRECATE_SOON(
1085
1109
  "Use maybe version",
1086
- Local<Script> Compile(Handle<String> source,
1110
+ Local<Script> Compile(Local<String> source,
1087
1111
  ScriptOrigin* origin = nullptr));
1088
1112
  static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
1089
- Local<Context> context, Handle<String> source,
1113
+ Local<Context> context, Local<String> source,
1090
1114
  ScriptOrigin* origin = nullptr);
1091
1115
 
1092
1116
  static Local<Script> V8_DEPRECATE_SOON("Use maybe version",
1093
- Compile(Handle<String> source,
1094
- Handle<String> file_name));
1117
+ Compile(Local<String> source,
1118
+ Local<String> file_name));
1095
1119
 
1096
1120
  /**
1097
1121
  * Runs the script returning the resulting value. It will be run in the
@@ -1105,11 +1129,6 @@ class V8_EXPORT Script {
1105
1129
  * Returns the corresponding context-unbound script.
1106
1130
  */
1107
1131
  Local<UnboundScript> GetUnboundScript();
1108
-
1109
- V8_DEPRECATED("Use GetUnboundScript()->GetId()",
1110
- int GetId()) {
1111
- return GetUnboundScript()->GetId();
1112
- }
1113
1132
  };
1114
1133
 
1115
1134
 
@@ -1183,11 +1202,11 @@ class V8_EXPORT ScriptCompiler {
1183
1202
  Local<String> source_string;
1184
1203
 
1185
1204
  // Origin information
1186
- Handle<Value> resource_name;
1187
- Handle<Integer> resource_line_offset;
1188
- Handle<Integer> resource_column_offset;
1205
+ Local<Value> resource_name;
1206
+ Local<Integer> resource_line_offset;
1207
+ Local<Integer> resource_column_offset;
1189
1208
  ScriptOriginOptions resource_options;
1190
- Handle<Value> source_map_url;
1209
+ Local<Value> source_map_url;
1191
1210
 
1192
1211
  // Cached data from previous compilation (if a kConsume*Cache flag is
1193
1212
  // set), or hold newly generated cache data (kProduce*Cache flags) are
@@ -1300,10 +1319,10 @@ class V8_EXPORT ScriptCompiler {
1300
1319
  * \return Compiled script object (context independent; for running it must be
1301
1320
  * bound to a context).
1302
1321
  */
1303
- static V8_DEPRECATE_SOON("Use maybe version",
1304
- Local<UnboundScript> CompileUnbound(
1305
- Isolate* isolate, Source* source,
1306
- CompileOptions options = kNoCompileOptions));
1322
+ static V8_DEPRECATED("Use maybe version",
1323
+ Local<UnboundScript> CompileUnbound(
1324
+ Isolate* isolate, Source* source,
1325
+ CompileOptions options = kNoCompileOptions));
1307
1326
  static V8_WARN_UNUSED_RESULT MaybeLocal<UnboundScript> CompileUnboundScript(
1308
1327
  Isolate* isolate, Source* source,
1309
1328
  CompileOptions options = kNoCompileOptions);
@@ -1319,7 +1338,7 @@ class V8_EXPORT ScriptCompiler {
1319
1338
  * when this function was called. When run it will always use this
1320
1339
  * context.
1321
1340
  */
1322
- static V8_DEPRECATE_SOON(
1341
+ static V8_DEPRECATED(
1323
1342
  "Use maybe version",
1324
1343
  Local<Script> Compile(Isolate* isolate, Source* source,
1325
1344
  CompileOptions options = kNoCompileOptions));
@@ -1349,14 +1368,14 @@ class V8_EXPORT ScriptCompiler {
1349
1368
  * (ScriptStreamingTask has been run). V8 doesn't construct the source string
1350
1369
  * during streaming, so the embedder needs to pass the full source here.
1351
1370
  */
1352
- static V8_DEPRECATE_SOON(
1353
- "Use maybe version",
1354
- Local<Script> Compile(Isolate* isolate, StreamedSource* source,
1355
- Handle<String> full_source_string,
1356
- const ScriptOrigin& origin));
1371
+ static V8_DEPRECATED("Use maybe version",
1372
+ Local<Script> Compile(Isolate* isolate,
1373
+ StreamedSource* source,
1374
+ Local<String> full_source_string,
1375
+ const ScriptOrigin& origin));
1357
1376
  static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
1358
1377
  Local<Context> context, StreamedSource* source,
1359
- Handle<String> full_source_string, const ScriptOrigin& origin);
1378
+ Local<String> full_source_string, const ScriptOrigin& origin);
1360
1379
 
1361
1380
  /**
1362
1381
  * Return a version tag for CachedData for the current V8 version & flags.
@@ -1381,15 +1400,13 @@ class V8_EXPORT ScriptCompiler {
1381
1400
  /**
1382
1401
  * Compile an ES6 module.
1383
1402
  *
1384
- * This is an experimental feature.
1403
+ * This is an unfinished experimental feature, and is only exposed
1404
+ * here for internal testing purposes.
1405
+ * Only parsing works at the moment. Do not use.
1385
1406
  *
1386
1407
  * TODO(adamk): Script is likely the wrong return value for this;
1387
1408
  * should return some new Module type.
1388
1409
  */
1389
- static V8_DEPRECATE_SOON(
1390
- "Use maybe version",
1391
- Local<Script> CompileModule(Isolate* isolate, Source* source,
1392
- CompileOptions options = kNoCompileOptions));
1393
1410
  static V8_WARN_UNUSED_RESULT MaybeLocal<Script> CompileModule(
1394
1411
  Local<Context> context, Source* source,
1395
1412
  CompileOptions options = kNoCompileOptions);
@@ -1443,14 +1460,14 @@ class V8_EXPORT Message {
1443
1460
  * Returns the resource name for the script from where the function causing
1444
1461
  * the error originates.
1445
1462
  */
1446
- Handle<Value> GetScriptResourceName() const;
1463
+ Local<Value> GetScriptResourceName() const;
1447
1464
 
1448
1465
  /**
1449
1466
  * Exception stack trace. By default stack traces are not captured for
1450
1467
  * uncaught exceptions. SetCaptureStackTraceForUncaughtExceptions allows
1451
1468
  * to change this option.
1452
1469
  */
1453
- Handle<StackTrace> GetStackTrace() const;
1470
+ Local<StackTrace> GetStackTrace() const;
1454
1471
 
1455
1472
  /**
1456
1473
  * Returns the number, 1-based, of the line where the error occurred.
@@ -1481,7 +1498,7 @@ class V8_EXPORT Message {
1481
1498
  * Returns the index within the line of the last character where
1482
1499
  * the error occurred.
1483
1500
  */
1484
- V8_DEPRECATE_SOON("Use maybe version", int GetEndColumn() const);
1501
+ V8_DEPRECATED("Use maybe version", int GetEndColumn() const);
1485
1502
  V8_WARN_UNUSED_RESULT Maybe<int> GetEndColumn(Local<Context> context) const;
1486
1503
 
1487
1504
  /**
@@ -1650,8 +1667,8 @@ class V8_EXPORT JSON {
1650
1667
  * \param json_string The string to parse.
1651
1668
  * \return The corresponding value if successfully parsed.
1652
1669
  */
1653
- static V8_DEPRECATE_SOON("Use maybe version",
1654
- Local<Value> Parse(Local<String> json_string));
1670
+ static V8_DEPRECATED("Use maybe version",
1671
+ Local<Value> Parse(Local<String> json_string));
1655
1672
  static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse(
1656
1673
  Isolate* isolate, Local<String> json_string);
1657
1674
  };
@@ -1665,10 +1682,10 @@ class V8_EXPORT JSON {
1665
1682
  class V8_EXPORT NativeWeakMap : public Data {
1666
1683
  public:
1667
1684
  static Local<NativeWeakMap> New(Isolate* isolate);
1668
- void Set(Handle<Value> key, Handle<Value> value);
1669
- Local<Value> Get(Handle<Value> key);
1670
- bool Has(Handle<Value> key);
1671
- bool Delete(Handle<Value> key);
1685
+ void Set(Local<Value> key, Local<Value> value);
1686
+ Local<Value> Get(Local<Value> key);
1687
+ bool Has(Local<Value> key);
1688
+ bool Delete(Local<Value> key);
1672
1689
  };
1673
1690
 
1674
1691
 
@@ -1726,7 +1743,8 @@ class V8_EXPORT Value : public Data {
1726
1743
  bool IsFunction() const;
1727
1744
 
1728
1745
  /**
1729
- * Returns true if this value is an array.
1746
+ * Returns true if this value is an array. Note that it will return false for
1747
+ * an Proxy for an array.
1730
1748
  */
1731
1749
  bool IsArray() const;
1732
1750
 
@@ -1939,6 +1957,11 @@ class V8_EXPORT Value : public Data {
1939
1957
  */
1940
1958
  bool IsSharedArrayBuffer() const;
1941
1959
 
1960
+ /**
1961
+ * Returns true if this value is a JavaScript Proxy.
1962
+ */
1963
+ bool IsProxy() const;
1964
+
1942
1965
 
1943
1966
  V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
1944
1967
  Local<Context> context) const;
@@ -1962,34 +1985,34 @@ class V8_EXPORT Value : public Data {
1962
1985
  Local<Number> ToNumber(Isolate* isolate) const);
1963
1986
  V8_DEPRECATE_SOON("Use maybe version",
1964
1987
  Local<String> ToString(Isolate* isolate) const);
1965
- V8_DEPRECATE_SOON("Use maybe version",
1966
- Local<String> ToDetailString(Isolate* isolate) const);
1988
+ V8_DEPRECATED("Use maybe version",
1989
+ Local<String> ToDetailString(Isolate* isolate) const);
1967
1990
  V8_DEPRECATE_SOON("Use maybe version",
1968
1991
  Local<Object> ToObject(Isolate* isolate) const);
1969
1992
  V8_DEPRECATE_SOON("Use maybe version",
1970
1993
  Local<Integer> ToInteger(Isolate* isolate) const);
1971
- V8_DEPRECATE_SOON("Use maybe version",
1972
- Local<Uint32> ToUint32(Isolate* isolate) const);
1994
+ V8_DEPRECATED("Use maybe version",
1995
+ Local<Uint32> ToUint32(Isolate* isolate) const);
1973
1996
  V8_DEPRECATE_SOON("Use maybe version",
1974
1997
  Local<Int32> ToInt32(Isolate* isolate) const);
1975
1998
 
1976
1999
  inline V8_DEPRECATE_SOON("Use maybe version",
1977
2000
  Local<Boolean> ToBoolean() const);
1978
- inline V8_DEPRECATE_SOON("Use maybe version", Local<Number> ToNumber() const);
2001
+ inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
1979
2002
  inline V8_DEPRECATE_SOON("Use maybe version", Local<String> ToString() const);
1980
- inline V8_DEPRECATE_SOON("Use maybe version",
1981
- Local<String> ToDetailString() const);
2003
+ inline V8_DEPRECATED("Use maybe version",
2004
+ Local<String> ToDetailString() const);
1982
2005
  inline V8_DEPRECATE_SOON("Use maybe version", Local<Object> ToObject() const);
1983
2006
  inline V8_DEPRECATE_SOON("Use maybe version",
1984
2007
  Local<Integer> ToInteger() const);
1985
- inline V8_DEPRECATE_SOON("Use maybe version", Local<Uint32> ToUint32() const);
1986
- inline V8_DEPRECATE_SOON("Use maybe version", Local<Int32> ToInt32() const);
2008
+ inline V8_DEPRECATED("Use maybe version", Local<Uint32> ToUint32() const);
2009
+ inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
1987
2010
 
1988
2011
  /**
1989
2012
  * Attempts to convert a string to an array index.
1990
2013
  * Returns an empty handle if the conversion fails.
1991
2014
  */
1992
- V8_DEPRECATE_SOON("Use maybe version", Local<Uint32> ToArrayIndex() const);
2015
+ V8_DEPRECATED("Use maybe version", Local<Uint32> ToArrayIndex() const);
1993
2016
  V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToArrayIndex(
1994
2017
  Local<Context> context) const;
1995
2018
 
@@ -2008,11 +2031,11 @@ class V8_EXPORT Value : public Data {
2008
2031
  V8_DEPRECATE_SOON("Use maybe version", int32_t Int32Value() const);
2009
2032
 
2010
2033
  /** JS == */
2011
- V8_DEPRECATE_SOON("Use maybe version", bool Equals(Handle<Value> that) const);
2034
+ V8_DEPRECATE_SOON("Use maybe version", bool Equals(Local<Value> that) const);
2012
2035
  V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
2013
- Handle<Value> that) const;
2014
- bool StrictEquals(Handle<Value> that) const;
2015
- bool SameValue(Handle<Value> that) const;
2036
+ Local<Value> that) const;
2037
+ bool StrictEquals(Local<Value> that) const;
2038
+ bool SameValue(Local<Value> that) const;
2016
2039
 
2017
2040
  template <class T> V8_INLINE static Value* Cast(T* value);
2018
2041
 
@@ -2040,7 +2063,8 @@ class V8_EXPORT Boolean : public Primitive {
2040
2063
  public:
2041
2064
  bool Value() const;
2042
2065
  V8_INLINE static Boolean* Cast(v8::Value* obj);
2043
- V8_INLINE static Handle<Boolean> New(Isolate* isolate, bool value);
2066
+ V8_INLINE static Local<Boolean> New(Isolate* isolate, bool value);
2067
+
2044
2068
  private:
2045
2069
  static void CheckCast(v8::Value* obj);
2046
2070
  };
@@ -2176,6 +2200,8 @@ class V8_EXPORT String : public Name {
2176
2200
  public:
2177
2201
  virtual ~ExternalStringResourceBase() {}
2178
2202
 
2203
+ virtual bool IsCompressible() const { return false; }
2204
+
2179
2205
  protected:
2180
2206
  ExternalStringResourceBase() {}
2181
2207
 
@@ -2292,7 +2318,7 @@ class V8_EXPORT String : public Name {
2292
2318
  int length = -1);
2293
2319
 
2294
2320
  /** Allocates a new string from Latin-1 data.*/
2295
- static V8_DEPRECATE_SOON(
2321
+ static V8_DEPRECATED(
2296
2322
  "Use maybe version",
2297
2323
  Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
2298
2324
  NewStringType type = kNormalString,
@@ -2321,7 +2347,7 @@ class V8_EXPORT String : public Name {
2321
2347
  * Creates a new string by concatenating the left and the right strings
2322
2348
  * passed in as parameters.
2323
2349
  */
2324
- static Local<String> Concat(Handle<String> left, Handle<String> right);
2350
+ static Local<String> Concat(Local<String> left, Local<String> right);
2325
2351
 
2326
2352
  /**
2327
2353
  * Creates a new external string using the data defined in the given
@@ -2331,10 +2357,9 @@ class V8_EXPORT String : public Name {
2331
2357
  * should the underlying buffer be deallocated or modified except through the
2332
2358
  * destructor of the external string resource.
2333
2359
  */
2334
- static V8_DEPRECATE_SOON(
2335
- "Use maybe version",
2336
- Local<String> NewExternal(Isolate* isolate,
2337
- ExternalStringResource* resource));
2360
+ static V8_DEPRECATED("Use maybe version",
2361
+ Local<String> NewExternal(
2362
+ Isolate* isolate, ExternalStringResource* resource));
2338
2363
  static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalTwoByte(
2339
2364
  Isolate* isolate, ExternalStringResource* resource);
2340
2365
 
@@ -2389,7 +2414,7 @@ class V8_EXPORT String : public Name {
2389
2414
  */
2390
2415
  class V8_EXPORT Utf8Value {
2391
2416
  public:
2392
- explicit Utf8Value(Handle<v8::Value> obj);
2417
+ explicit Utf8Value(Local<v8::Value> obj);
2393
2418
  ~Utf8Value();
2394
2419
  char* operator*() { return str_; }
2395
2420
  const char* operator*() const { return str_; }
@@ -2411,7 +2436,7 @@ class V8_EXPORT String : public Name {
2411
2436
  */
2412
2437
  class V8_EXPORT Value {
2413
2438
  public:
2414
- explicit Value(Handle<v8::Value> obj);
2439
+ explicit Value(Local<v8::Value> obj);
2415
2440
  ~Value();
2416
2441
  uint16_t* operator*() { return str_; }
2417
2442
  const uint16_t* operator*() const { return str_; }
@@ -2444,8 +2469,8 @@ class V8_EXPORT Symbol : public Name {
2444
2469
  Local<Value> Name() const;
2445
2470
 
2446
2471
  // Create a symbol. If name is not empty, it will be used as the description.
2447
- static Local<Symbol> New(
2448
- Isolate *isolate, Local<String> name = Local<String>());
2472
+ static Local<Symbol> New(Isolate* isolate,
2473
+ Local<String> name = Local<String>());
2449
2474
 
2450
2475
  // Access global symbol registry.
2451
2476
  // Note that symbols created this way are never collected, so
@@ -2462,6 +2487,7 @@ class V8_EXPORT Symbol : public Name {
2462
2487
  static Local<Symbol> GetIterator(Isolate* isolate);
2463
2488
  static Local<Symbol> GetUnscopables(Isolate* isolate);
2464
2489
  static Local<Symbol> GetToStringTag(Isolate* isolate);
2490
+ static Local<Symbol> GetIsConcatSpreadable(Isolate* isolate);
2465
2491
 
2466
2492
  V8_INLINE static Symbol* Cast(v8::Value* obj);
2467
2493
 
@@ -2471,6 +2497,34 @@ class V8_EXPORT Symbol : public Name {
2471
2497
  };
2472
2498
 
2473
2499
 
2500
+ /**
2501
+ * A private symbol
2502
+ *
2503
+ * This is an experimental feature. Use at your own risk.
2504
+ */
2505
+ class V8_EXPORT Private : public Data {
2506
+ public:
2507
+ // Returns the print name string of the private symbol, or undefined if none.
2508
+ Local<Value> Name() const;
2509
+
2510
+ // Create a private symbol. If name is not empty, it will be the description.
2511
+ static Local<Private> New(Isolate* isolate,
2512
+ Local<String> name = Local<String>());
2513
+
2514
+ // Retrieve a global private symbol. If a symbol with this name has not
2515
+ // been retrieved in the same isolate before, it is created.
2516
+ // Note that private symbols created this way are never collected, so
2517
+ // they should only be used for statically fixed properties.
2518
+ // Also, there is only one global name space for the names used as keys.
2519
+ // To minimize the potential for clashes, use qualified names as keys,
2520
+ // e.g., "Class#property".
2521
+ static Local<Private> ForApi(Isolate* isolate, Local<String> name);
2522
+
2523
+ private:
2524
+ Private();
2525
+ };
2526
+
2527
+
2474
2528
  /**
2475
2529
  * A JavaScript number value (ECMA-262, 4.3.20)
2476
2530
  */
@@ -2581,12 +2635,12 @@ enum AccessControl {
2581
2635
  class V8_EXPORT Object : public Value {
2582
2636
  public:
2583
2637
  V8_DEPRECATE_SOON("Use maybe version",
2584
- bool Set(Handle<Value> key, Handle<Value> value));
2638
+ bool Set(Local<Value> key, Local<Value> value));
2585
2639
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2586
2640
  Local<Value> key, Local<Value> value);
2587
2641
 
2588
2642
  V8_DEPRECATE_SOON("Use maybe version",
2589
- bool Set(uint32_t index, Handle<Value> value));
2643
+ bool Set(uint32_t index, Local<Value> value));
2590
2644
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2591
2645
  Local<Value> value);
2592
2646
 
@@ -2622,15 +2676,15 @@ class V8_EXPORT Object : public Value {
2622
2676
  // will only be returned if the interceptor doesn't return a value.
2623
2677
  //
2624
2678
  // Note also that this only works for named properties.
2625
- V8_DEPRECATE_SOON("Use CreateDataProperty",
2626
- bool ForceSet(Handle<Value> key, Handle<Value> value,
2627
- PropertyAttribute attribs = None));
2628
- V8_DEPRECATE_SOON("Use CreateDataProperty",
2679
+ V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty",
2680
+ bool ForceSet(Local<Value> key, Local<Value> value,
2681
+ PropertyAttribute attribs = None));
2682
+ V8_DEPRECATE_SOON("Use CreateDataProperty / DefineOwnProperty",
2629
2683
  Maybe<bool> ForceSet(Local<Context> context,
2630
2684
  Local<Value> key, Local<Value> value,
2631
2685
  PropertyAttribute attribs = None));
2632
2686
 
2633
- V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Handle<Value> key));
2687
+ V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
2634
2688
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
2635
2689
  Local<Value> key);
2636
2690
 
@@ -2643,48 +2697,48 @@ class V8_EXPORT Object : public Value {
2643
2697
  * any combination of ReadOnly, DontEnum and DontDelete. Returns
2644
2698
  * None when the property doesn't exist.
2645
2699
  */
2646
- V8_DEPRECATE_SOON("Use maybe version",
2647
- PropertyAttribute GetPropertyAttributes(Handle<Value> key));
2700
+ V8_DEPRECATED("Use maybe version",
2701
+ PropertyAttribute GetPropertyAttributes(Local<Value> key));
2648
2702
  V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetPropertyAttributes(
2649
2703
  Local<Context> context, Local<Value> key);
2650
2704
 
2651
2705
  /**
2652
2706
  * Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3.
2653
2707
  */
2654
- V8_DEPRECATE_SOON("Use maybe version",
2655
- Local<Value> GetOwnPropertyDescriptor(Local<String> key));
2708
+ V8_DEPRECATED("Use maybe version",
2709
+ Local<Value> GetOwnPropertyDescriptor(Local<String> key));
2656
2710
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetOwnPropertyDescriptor(
2657
2711
  Local<Context> context, Local<String> key);
2658
2712
 
2659
- V8_DEPRECATE_SOON("Use maybe version", bool Has(Handle<Value> key));
2713
+ V8_DEPRECATE_SOON("Use maybe version", bool Has(Local<Value> key));
2660
2714
  V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
2661
2715
  Local<Value> key);
2662
2716
 
2663
- V8_DEPRECATE_SOON("Use maybe version", bool Delete(Handle<Value> key));
2717
+ V8_DEPRECATE_SOON("Use maybe version", bool Delete(Local<Value> key));
2664
2718
  // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
2665
2719
  Maybe<bool> Delete(Local<Context> context, Local<Value> key);
2666
2720
 
2667
- V8_DEPRECATE_SOON("Use maybe version", bool Has(uint32_t index));
2721
+ V8_DEPRECATED("Use maybe version", bool Has(uint32_t index));
2668
2722
  V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
2669
2723
 
2670
- V8_DEPRECATE_SOON("Use maybe version", bool Delete(uint32_t index));
2724
+ V8_DEPRECATED("Use maybe version", bool Delete(uint32_t index));
2671
2725
  // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
2672
2726
  Maybe<bool> Delete(Local<Context> context, uint32_t index);
2673
2727
 
2674
- V8_DEPRECATE_SOON("Use maybe version",
2675
- bool SetAccessor(Handle<String> name,
2676
- AccessorGetterCallback getter,
2677
- AccessorSetterCallback setter = 0,
2678
- Handle<Value> data = Handle<Value>(),
2679
- AccessControl settings = DEFAULT,
2680
- PropertyAttribute attribute = None));
2681
- V8_DEPRECATE_SOON("Use maybe version",
2682
- bool SetAccessor(Handle<Name> name,
2683
- AccessorNameGetterCallback getter,
2684
- AccessorNameSetterCallback setter = 0,
2685
- Handle<Value> data = Handle<Value>(),
2686
- AccessControl settings = DEFAULT,
2687
- PropertyAttribute attribute = None));
2728
+ V8_DEPRECATED("Use maybe version",
2729
+ bool SetAccessor(Local<String> name,
2730
+ AccessorGetterCallback getter,
2731
+ AccessorSetterCallback setter = 0,
2732
+ Local<Value> data = Local<Value>(),
2733
+ AccessControl settings = DEFAULT,
2734
+ PropertyAttribute attribute = None));
2735
+ V8_DEPRECATED("Use maybe version",
2736
+ bool SetAccessor(Local<Name> name,
2737
+ AccessorNameGetterCallback getter,
2738
+ AccessorNameSetterCallback setter = 0,
2739
+ Local<Value> data = Local<Value>(),
2740
+ AccessControl settings = DEFAULT,
2741
+ PropertyAttribute attribute = None));
2688
2742
  // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
2689
2743
  Maybe<bool> SetAccessor(Local<Context> context, Local<Name> name,
2690
2744
  AccessorNameGetterCallback getter,
@@ -2693,12 +2747,23 @@ class V8_EXPORT Object : public Value {
2693
2747
  AccessControl settings = DEFAULT,
2694
2748
  PropertyAttribute attribute = None);
2695
2749
 
2696
- void SetAccessorProperty(Local<Name> name,
2697
- Local<Function> getter,
2698
- Handle<Function> setter = Handle<Function>(),
2750
+ void SetAccessorProperty(Local<Name> name, Local<Function> getter,
2751
+ Local<Function> setter = Local<Function>(),
2699
2752
  PropertyAttribute attribute = None,
2700
2753
  AccessControl settings = DEFAULT);
2701
2754
 
2755
+ /**
2756
+ * Functionality for private properties.
2757
+ * This is an experimental feature, use at your own risk.
2758
+ * Note: Private properties are not inherited. Do not rely on this, since it
2759
+ * may change.
2760
+ */
2761
+ Maybe<bool> HasPrivate(Local<Context> context, Local<Private> key);
2762
+ Maybe<bool> SetPrivate(Local<Context> context, Local<Private> key,
2763
+ Local<Value> value);
2764
+ Maybe<bool> DeletePrivate(Local<Context> context, Local<Private> key);
2765
+ MaybeLocal<Value> GetPrivate(Local<Context> context, Local<Private> key);
2766
+
2702
2767
  /**
2703
2768
  * Returns an array containing the names of the enumerable properties
2704
2769
  * of this object, including properties from prototype objects. The
@@ -2730,8 +2795,7 @@ class V8_EXPORT Object : public Value {
2730
2795
  * be skipped by __proto__ and it does not consult the security
2731
2796
  * handler.
2732
2797
  */
2733
- V8_DEPRECATE_SOON("Use maybe version",
2734
- bool SetPrototype(Handle<Value> prototype));
2798
+ V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
2735
2799
  V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
2736
2800
  Local<Value> prototype);
2737
2801
 
@@ -2739,14 +2803,14 @@ class V8_EXPORT Object : public Value {
2739
2803
  * Finds an instance of the given function template in the prototype
2740
2804
  * chain.
2741
2805
  */
2742
- Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl);
2806
+ Local<Object> FindInstanceInPrototypeChain(Local<FunctionTemplate> tmpl);
2743
2807
 
2744
2808
  /**
2745
2809
  * Call builtin Object.prototype.toString on this object.
2746
2810
  * This is different from Value::ToString() that may call
2747
2811
  * user-defined toString function. This one does not.
2748
2812
  */
2749
- V8_DEPRECATE_SOON("Use maybe version", Local<String> ObjectProtoToString());
2813
+ V8_DEPRECATED("Use maybe version", Local<String> ObjectProtoToString());
2750
2814
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ObjectProtoToString(
2751
2815
  Local<Context> context);
2752
2816
 
@@ -2768,7 +2832,7 @@ class V8_EXPORT Object : public Value {
2768
2832
  V8_INLINE Local<Value> GetInternalField(int index);
2769
2833
 
2770
2834
  /** Sets the value in an internal field. */
2771
- void SetInternalField(int index, Handle<Value> value);
2835
+ void SetInternalField(int index, Local<Value> value);
2772
2836
 
2773
2837
  /**
2774
2838
  * Gets a 2-byte-aligned native pointer from an internal field. This field
@@ -2791,12 +2855,11 @@ class V8_EXPORT Object : public Value {
2791
2855
  void SetAlignedPointerInInternalField(int index, void* value);
2792
2856
 
2793
2857
  // Testers for local properties.
2794
- V8_DEPRECATE_SOON("Use maybe version",
2795
- bool HasOwnProperty(Handle<String> key));
2858
+ V8_DEPRECATED("Use maybe version", bool HasOwnProperty(Local<String> key));
2796
2859
  V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context,
2797
2860
  Local<Name> key);
2798
2861
  V8_DEPRECATE_SOON("Use maybe version",
2799
- bool HasRealNamedProperty(Handle<String> key));
2862
+ bool HasRealNamedProperty(Local<String> key));
2800
2863
  V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context,
2801
2864
  Local<Name> key);
2802
2865
  V8_DEPRECATE_SOON("Use maybe version",
@@ -2804,7 +2867,7 @@ class V8_EXPORT Object : public Value {
2804
2867
  V8_WARN_UNUSED_RESULT Maybe<bool> HasRealIndexedProperty(
2805
2868
  Local<Context> context, uint32_t index);
2806
2869
  V8_DEPRECATE_SOON("Use maybe version",
2807
- bool HasRealNamedCallbackProperty(Handle<String> key));
2870
+ bool HasRealNamedCallbackProperty(Local<String> key));
2808
2871
  V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedCallbackProperty(
2809
2872
  Local<Context> context, Local<Name> key);
2810
2873
 
@@ -2812,9 +2875,9 @@ class V8_EXPORT Object : public Value {
2812
2875
  * If result.IsEmpty() no real property was located in the prototype chain.
2813
2876
  * This means interceptors in the prototype chain are not called.
2814
2877
  */
2815
- V8_DEPRECATE_SOON(
2878
+ V8_DEPRECATED(
2816
2879
  "Use maybe version",
2817
- Local<Value> GetRealNamedPropertyInPrototypeChain(Handle<String> key));
2880
+ Local<Value> GetRealNamedPropertyInPrototypeChain(Local<String> key));
2818
2881
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedPropertyInPrototypeChain(
2819
2882
  Local<Context> context, Local<Name> key);
2820
2883
 
@@ -2823,10 +2886,10 @@ class V8_EXPORT Object : public Value {
2823
2886
  * which can be None or any combination of ReadOnly, DontEnum and DontDelete.
2824
2887
  * Interceptors in the prototype chain are not called.
2825
2888
  */
2826
- V8_DEPRECATE_SOON(
2889
+ V8_DEPRECATED(
2827
2890
  "Use maybe version",
2828
2891
  Maybe<PropertyAttribute> GetRealNamedPropertyAttributesInPrototypeChain(
2829
- Handle<String> key));
2892
+ Local<String> key));
2830
2893
  V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute>
2831
2894
  GetRealNamedPropertyAttributesInPrototypeChain(Local<Context> context,
2832
2895
  Local<Name> key);
@@ -2836,8 +2899,8 @@ class V8_EXPORT Object : public Value {
2836
2899
  * in the prototype chain.
2837
2900
  * This means interceptors in the prototype chain are not called.
2838
2901
  */
2839
- V8_DEPRECATE_SOON("Use maybe version",
2840
- Local<Value> GetRealNamedProperty(Handle<String> key));
2902
+ V8_DEPRECATED("Use maybe version",
2903
+ Local<Value> GetRealNamedProperty(Local<String> key));
2841
2904
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
2842
2905
  Local<Context> context, Local<Name> key);
2843
2906
 
@@ -2846,9 +2909,9 @@ class V8_EXPORT Object : public Value {
2846
2909
  * None or any combination of ReadOnly, DontEnum and DontDelete.
2847
2910
  * Interceptors in the prototype chain are not called.
2848
2911
  */
2849
- V8_DEPRECATE_SOON("Use maybe version",
2850
- Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
2851
- Handle<String> key));
2912
+ V8_DEPRECATED("Use maybe version",
2913
+ Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
2914
+ Local<String> key));
2852
2915
  V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
2853
2916
  Local<Context> context, Local<Name> key);
2854
2917
 
@@ -2867,16 +2930,12 @@ class V8_EXPORT Object : public Value {
2867
2930
  */
2868
2931
  int GetIdentityHash();
2869
2932
 
2870
- /**
2871
- * Access hidden properties on JavaScript objects. These properties are
2872
- * hidden from the executing JavaScript and only accessible through the V8
2873
- * C++ API. Hidden properties introduced by V8 internally (for example the
2874
- * identity hash) are prefixed with "v8::".
2875
- */
2876
- // TODO(dcarney): convert these to take a isolate and optionally bailout?
2877
- bool SetHiddenValue(Handle<String> key, Handle<Value> value);
2878
- Local<Value> GetHiddenValue(Handle<String> key);
2879
- bool DeleteHiddenValue(Handle<String> key);
2933
+ V8_DEPRECATED("Use v8::Object::SetPrivate instead.",
2934
+ bool SetHiddenValue(Local<String> key, Local<Value> value));
2935
+ V8_DEPRECATED("Use v8::Object::GetPrivate instead.",
2936
+ Local<Value> GetHiddenValue(Local<String> key));
2937
+ V8_DEPRECATED("Use v8::Object::DeletePrivate instead.",
2938
+ bool DeleteHiddenValue(Local<String> key));
2880
2939
 
2881
2940
  /**
2882
2941
  * Clone this object with a fast but shallow copy. Values will point
@@ -2901,22 +2960,21 @@ class V8_EXPORT Object : public Value {
2901
2960
  * Call an Object as a function if a callback is set by the
2902
2961
  * ObjectTemplate::SetCallAsFunctionHandler method.
2903
2962
  */
2904
- V8_DEPRECATE_SOON("Use maybe version",
2905
- Local<Value> CallAsFunction(Handle<Value> recv, int argc,
2906
- Handle<Value> argv[]));
2963
+ V8_DEPRECATED("Use maybe version",
2964
+ Local<Value> CallAsFunction(Local<Value> recv, int argc,
2965
+ Local<Value> argv[]));
2907
2966
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context,
2908
- Handle<Value> recv,
2967
+ Local<Value> recv,
2909
2968
  int argc,
2910
- Handle<Value> argv[]);
2969
+ Local<Value> argv[]);
2911
2970
 
2912
2971
  /**
2913
2972
  * Call an Object as a constructor if a callback is set by the
2914
2973
  * ObjectTemplate::SetCallAsFunctionHandler method.
2915
2974
  * Note: This method behaves like the Function::NewInstance method.
2916
2975
  */
2917
- V8_DEPRECATE_SOON("Use maybe version",
2918
- Local<Value> CallAsConstructor(int argc,
2919
- Handle<Value> argv[]));
2976
+ V8_DEPRECATED("Use maybe version",
2977
+ Local<Value> CallAsConstructor(int argc, Local<Value> argv[]));
2920
2978
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsConstructor(
2921
2979
  Local<Context> context, int argc, Local<Value> argv[]);
2922
2980
 
@@ -2948,10 +3006,11 @@ class V8_EXPORT Array : public Object {
2948
3006
  * Clones an element at index |index|. Returns an empty
2949
3007
  * handle if cloning fails (for any reason).
2950
3008
  */
2951
- V8_DEPRECATE_SOON("Use maybe version",
2952
- Local<Object> CloneElementAt(uint32_t index));
2953
- V8_WARN_UNUSED_RESULT MaybeLocal<Object> CloneElementAt(
2954
- Local<Context> context, uint32_t index);
3009
+ V8_DEPRECATED("Cloning is not supported.",
3010
+ Local<Object> CloneElementAt(uint32_t index));
3011
+ V8_DEPRECATED("Cloning is not supported.",
3012
+ MaybeLocal<Object> CloneElementAt(Local<Context> context,
3013
+ uint32_t index));
2955
3014
 
2956
3015
  /**
2957
3016
  * Creates a JavaScript array with the given length. If the length
@@ -2994,14 +3053,6 @@ class V8_EXPORT Map : public Object {
2994
3053
  */
2995
3054
  static Local<Map> New(Isolate* isolate);
2996
3055
 
2997
- /**
2998
- * Creates a new Map containing the elements of array, which must be formatted
2999
- * in the same manner as the array returned from AsArray().
3000
- * Guaranteed to be side-effect free if the array contains no holes.
3001
- */
3002
- static V8_WARN_UNUSED_RESULT MaybeLocal<Map> FromArray(Local<Context> context,
3003
- Local<Array> array);
3004
-
3005
3056
  V8_INLINE static Map* Cast(Value* obj);
3006
3057
 
3007
3058
  private:
@@ -3034,13 +3085,6 @@ class V8_EXPORT Set : public Object {
3034
3085
  */
3035
3086
  static Local<Set> New(Isolate* isolate);
3036
3087
 
3037
- /**
3038
- * Creates a new Set containing the items in array.
3039
- * Guaranteed to be side-effect free if the array contains no holes.
3040
- */
3041
- static V8_WARN_UNUSED_RESULT MaybeLocal<Set> FromArray(Local<Context> context,
3042
- Local<Array> array);
3043
-
3044
3088
  V8_INLINE static Set* Cast(Value* obj);
3045
3089
 
3046
3090
  private:
@@ -3056,7 +3100,7 @@ class ReturnValue {
3056
3100
  : value_(that.value_) {
3057
3101
  TYPE_CHECK(T, S);
3058
3102
  }
3059
- // Handle setters
3103
+ // Local setters
3060
3104
  template <typename S>
3061
3105
  V8_INLINE V8_DEPRECATE_SOON("Use Global<> instead",
3062
3106
  void Set(const Persistent<S>& handle));
@@ -3104,7 +3148,8 @@ class FunctionCallbackInfo {
3104
3148
  public:
3105
3149
  V8_INLINE int Length() const;
3106
3150
  V8_INLINE Local<Value> operator[](int i) const;
3107
- V8_INLINE Local<Function> Callee() const;
3151
+ V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead",
3152
+ Local<Function> Callee() const);
3108
3153
  V8_INLINE Local<Object> This() const;
3109
3154
  V8_INLINE Local<Object> Holder() const;
3110
3155
  V8_INLINE bool IsConstructCall() const;
@@ -3148,19 +3193,21 @@ class PropertyCallbackInfo {
3148
3193
  V8_INLINE Local<Object> This() const;
3149
3194
  V8_INLINE Local<Object> Holder() const;
3150
3195
  V8_INLINE ReturnValue<T> GetReturnValue() const;
3196
+ V8_INLINE bool ShouldThrowOnError() const;
3151
3197
  // This shouldn't be public, but the arm compiler needs it.
3152
- static const int kArgsLength = 6;
3198
+ static const int kArgsLength = 7;
3153
3199
 
3154
3200
  protected:
3155
3201
  friend class MacroAssembler;
3156
3202
  friend class internal::PropertyCallbackArguments;
3157
3203
  friend class internal::CustomArguments<PropertyCallbackInfo>;
3158
- static const int kHolderIndex = 0;
3159
- static const int kIsolateIndex = 1;
3160
- static const int kReturnValueDefaultValueIndex = 2;
3161
- static const int kReturnValueIndex = 3;
3162
- static const int kDataIndex = 4;
3163
- static const int kThisIndex = 5;
3204
+ static const int kShouldThrowOnErrorIndex = 0;
3205
+ static const int kHolderIndex = 1;
3206
+ static const int kIsolateIndex = 2;
3207
+ static const int kReturnValueDefaultValueIndex = 3;
3208
+ static const int kReturnValueIndex = 4;
3209
+ static const int kDataIndex = 5;
3210
+ static const int kThisIndex = 6;
3164
3211
 
3165
3212
  V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {}
3166
3213
  internal::Object** args_;
@@ -3188,27 +3235,26 @@ class V8_EXPORT Function : public Object {
3188
3235
  Local<Function> New(Isolate* isolate, FunctionCallback callback,
3189
3236
  Local<Value> data = Local<Value>(), int length = 0));
3190
3237
 
3191
- V8_DEPRECATE_SOON("Use maybe version",
3192
- Local<Object> NewInstance(int argc, Handle<Value> argv[])
3193
- const);
3238
+ V8_DEPRECATED("Use maybe version",
3239
+ Local<Object> NewInstance(int argc, Local<Value> argv[]) const);
3194
3240
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
3195
- Local<Context> context, int argc, Handle<Value> argv[]) const;
3241
+ Local<Context> context, int argc, Local<Value> argv[]) const;
3196
3242
 
3197
- V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance() const);
3243
+ V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
3198
3244
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
3199
3245
  Local<Context> context) const {
3200
3246
  return NewInstance(context, 0, nullptr);
3201
3247
  }
3202
3248
 
3203
3249
  V8_DEPRECATE_SOON("Use maybe version",
3204
- Local<Value> Call(Handle<Value> recv, int argc,
3205
- Handle<Value> argv[]));
3250
+ Local<Value> Call(Local<Value> recv, int argc,
3251
+ Local<Value> argv[]));
3206
3252
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context,
3207
- Handle<Value> recv, int argc,
3208
- Handle<Value> argv[]);
3253
+ Local<Value> recv, int argc,
3254
+ Local<Value> argv[]);
3209
3255
 
3210
- void SetName(Handle<String> name);
3211
- Handle<Value> GetName() const;
3256
+ void SetName(Local<String> name);
3257
+ Local<Value> GetName() const;
3212
3258
 
3213
3259
  /**
3214
3260
  * Name inferred from variable or property assignment of this function.
@@ -3216,13 +3262,19 @@ class V8_EXPORT Function : public Object {
3216
3262
  * in an OO style, where many functions are anonymous but are assigned
3217
3263
  * to object properties.
3218
3264
  */
3219
- Handle<Value> GetInferredName() const;
3265
+ Local<Value> GetInferredName() const;
3266
+
3267
+ /**
3268
+ * displayName if it is set, otherwise name if it is configured, otherwise
3269
+ * function name, otherwise inferred name.
3270
+ */
3271
+ Local<Value> GetDebugName() const;
3220
3272
 
3221
3273
  /**
3222
3274
  * User-defined name assigned to the "displayName" property of this function.
3223
3275
  * Used to facilitate debugging and profiling of JavaScript code.
3224
3276
  */
3225
- Handle<Value> GetDisplayName() const;
3277
+ Local<Value> GetDisplayName() const;
3226
3278
 
3227
3279
  /**
3228
3280
  * Returns zero based line number of function body and
@@ -3286,13 +3338,13 @@ class V8_EXPORT Promise : public Object {
3286
3338
  * Resolve/reject the associated promise with a given value.
3287
3339
  * Ignored if the promise is no longer pending.
3288
3340
  */
3289
- V8_DEPRECATE_SOON("Use maybe version", void Resolve(Handle<Value> value));
3341
+ V8_DEPRECATE_SOON("Use maybe version", void Resolve(Local<Value> value));
3290
3342
  // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
3291
- Maybe<bool> Resolve(Local<Context> context, Handle<Value> value);
3343
+ Maybe<bool> Resolve(Local<Context> context, Local<Value> value);
3292
3344
 
3293
- V8_DEPRECATE_SOON("Use maybe version", void Reject(Handle<Value> value));
3345
+ V8_DEPRECATE_SOON("Use maybe version", void Reject(Local<Value> value));
3294
3346
  // TODO(dcarney): mark V8_WARN_UNUSED_RESULT
3295
- Maybe<bool> Reject(Local<Context> context, Handle<Value> value);
3347
+ Maybe<bool> Reject(Local<Context> context, Local<Value> value);
3296
3348
 
3297
3349
  V8_INLINE static Resolver* Cast(Value* obj);
3298
3350
 
@@ -3307,20 +3359,21 @@ class V8_EXPORT Promise : public Object {
3307
3359
  * an argument. If the promise is already resolved/rejected, the handler is
3308
3360
  * invoked at the end of turn.
3309
3361
  */
3310
- V8_DEPRECATE_SOON("Use maybe version",
3311
- Local<Promise> Chain(Handle<Function> handler));
3312
- V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Chain(Local<Context> context,
3313
- Handle<Function> handler);
3362
+ V8_DEPRECATED("Use maybe version of Then",
3363
+ Local<Promise> Chain(Local<Function> handler));
3364
+ V8_DEPRECATED("Use Then",
3365
+ V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Chain(
3366
+ Local<Context> context, Local<Function> handler));
3314
3367
 
3315
- V8_DEPRECATE_SOON("Use maybe version",
3316
- Local<Promise> Catch(Handle<Function> handler));
3368
+ V8_DEPRECATED("Use maybe version",
3369
+ Local<Promise> Catch(Local<Function> handler));
3317
3370
  V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context,
3318
- Handle<Function> handler);
3371
+ Local<Function> handler);
3319
3372
 
3320
- V8_DEPRECATE_SOON("Use maybe version",
3321
- Local<Promise> Then(Handle<Function> handler));
3373
+ V8_DEPRECATED("Use maybe version",
3374
+ Local<Promise> Then(Local<Function> handler));
3322
3375
  V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context,
3323
- Handle<Function> handler);
3376
+ Local<Function> handler);
3324
3377
 
3325
3378
  /**
3326
3379
  * Returns true if the promise has at least one derived promise, and
@@ -3336,6 +3389,32 @@ class V8_EXPORT Promise : public Object {
3336
3389
  };
3337
3390
 
3338
3391
 
3392
+ /**
3393
+ * An instance of the built-in Proxy constructor (ECMA-262, 6th Edition,
3394
+ * 26.2.1).
3395
+ */
3396
+ class V8_EXPORT Proxy : public Object {
3397
+ public:
3398
+ Local<Object> GetTarget();
3399
+ Local<Value> GetHandler();
3400
+ bool IsRevoked();
3401
+ void Revoke();
3402
+
3403
+ /**
3404
+ * Creates a new empty Map.
3405
+ */
3406
+ static MaybeLocal<Proxy> New(Local<Context> context,
3407
+ Local<Object> local_target,
3408
+ Local<Object> local_handler);
3409
+
3410
+ V8_INLINE static Proxy* Cast(Value* obj);
3411
+
3412
+ private:
3413
+ Proxy();
3414
+ static void CheckCast(Value* obj);
3415
+ };
3416
+
3417
+
3339
3418
  #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
3340
3419
  // The number of required internal fields can be defined by embedder.
3341
3420
  #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
@@ -3562,9 +3641,9 @@ class V8_EXPORT TypedArray : public ArrayBufferView {
3562
3641
  */
3563
3642
  class V8_EXPORT Uint8Array : public TypedArray {
3564
3643
  public:
3565
- static Local<Uint8Array> New(Handle<ArrayBuffer> array_buffer,
3644
+ static Local<Uint8Array> New(Local<ArrayBuffer> array_buffer,
3566
3645
  size_t byte_offset, size_t length);
3567
- static Local<Uint8Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3646
+ static Local<Uint8Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3568
3647
  size_t byte_offset, size_t length);
3569
3648
  V8_INLINE static Uint8Array* Cast(Value* obj);
3570
3649
 
@@ -3580,10 +3659,10 @@ class V8_EXPORT Uint8Array : public TypedArray {
3580
3659
  */
3581
3660
  class V8_EXPORT Uint8ClampedArray : public TypedArray {
3582
3661
  public:
3583
- static Local<Uint8ClampedArray> New(Handle<ArrayBuffer> array_buffer,
3584
- size_t byte_offset, size_t length);
3662
+ static Local<Uint8ClampedArray> New(Local<ArrayBuffer> array_buffer,
3663
+ size_t byte_offset, size_t length);
3585
3664
  static Local<Uint8ClampedArray> New(
3586
- Handle<SharedArrayBuffer> shared_array_buffer, size_t byte_offset,
3665
+ Local<SharedArrayBuffer> shared_array_buffer, size_t byte_offset,
3587
3666
  size_t length);
3588
3667
  V8_INLINE static Uint8ClampedArray* Cast(Value* obj);
3589
3668
 
@@ -3598,9 +3677,9 @@ class V8_EXPORT Uint8ClampedArray : public TypedArray {
3598
3677
  */
3599
3678
  class V8_EXPORT Int8Array : public TypedArray {
3600
3679
  public:
3601
- static Local<Int8Array> New(Handle<ArrayBuffer> array_buffer,
3602
- size_t byte_offset, size_t length);
3603
- static Local<Int8Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3680
+ static Local<Int8Array> New(Local<ArrayBuffer> array_buffer,
3681
+ size_t byte_offset, size_t length);
3682
+ static Local<Int8Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3604
3683
  size_t byte_offset, size_t length);
3605
3684
  V8_INLINE static Int8Array* Cast(Value* obj);
3606
3685
 
@@ -3616,9 +3695,9 @@ class V8_EXPORT Int8Array : public TypedArray {
3616
3695
  */
3617
3696
  class V8_EXPORT Uint16Array : public TypedArray {
3618
3697
  public:
3619
- static Local<Uint16Array> New(Handle<ArrayBuffer> array_buffer,
3620
- size_t byte_offset, size_t length);
3621
- static Local<Uint16Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3698
+ static Local<Uint16Array> New(Local<ArrayBuffer> array_buffer,
3699
+ size_t byte_offset, size_t length);
3700
+ static Local<Uint16Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3622
3701
  size_t byte_offset, size_t length);
3623
3702
  V8_INLINE static Uint16Array* Cast(Value* obj);
3624
3703
 
@@ -3634,9 +3713,9 @@ class V8_EXPORT Uint16Array : public TypedArray {
3634
3713
  */
3635
3714
  class V8_EXPORT Int16Array : public TypedArray {
3636
3715
  public:
3637
- static Local<Int16Array> New(Handle<ArrayBuffer> array_buffer,
3716
+ static Local<Int16Array> New(Local<ArrayBuffer> array_buffer,
3638
3717
  size_t byte_offset, size_t length);
3639
- static Local<Int16Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3718
+ static Local<Int16Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3640
3719
  size_t byte_offset, size_t length);
3641
3720
  V8_INLINE static Int16Array* Cast(Value* obj);
3642
3721
 
@@ -3652,9 +3731,9 @@ class V8_EXPORT Int16Array : public TypedArray {
3652
3731
  */
3653
3732
  class V8_EXPORT Uint32Array : public TypedArray {
3654
3733
  public:
3655
- static Local<Uint32Array> New(Handle<ArrayBuffer> array_buffer,
3656
- size_t byte_offset, size_t length);
3657
- static Local<Uint32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3734
+ static Local<Uint32Array> New(Local<ArrayBuffer> array_buffer,
3735
+ size_t byte_offset, size_t length);
3736
+ static Local<Uint32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3658
3737
  size_t byte_offset, size_t length);
3659
3738
  V8_INLINE static Uint32Array* Cast(Value* obj);
3660
3739
 
@@ -3670,9 +3749,9 @@ class V8_EXPORT Uint32Array : public TypedArray {
3670
3749
  */
3671
3750
  class V8_EXPORT Int32Array : public TypedArray {
3672
3751
  public:
3673
- static Local<Int32Array> New(Handle<ArrayBuffer> array_buffer,
3752
+ static Local<Int32Array> New(Local<ArrayBuffer> array_buffer,
3674
3753
  size_t byte_offset, size_t length);
3675
- static Local<Int32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3754
+ static Local<Int32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3676
3755
  size_t byte_offset, size_t length);
3677
3756
  V8_INLINE static Int32Array* Cast(Value* obj);
3678
3757
 
@@ -3688,9 +3767,9 @@ class V8_EXPORT Int32Array : public TypedArray {
3688
3767
  */
3689
3768
  class V8_EXPORT Float32Array : public TypedArray {
3690
3769
  public:
3691
- static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer,
3692
- size_t byte_offset, size_t length);
3693
- static Local<Float32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3770
+ static Local<Float32Array> New(Local<ArrayBuffer> array_buffer,
3771
+ size_t byte_offset, size_t length);
3772
+ static Local<Float32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3694
3773
  size_t byte_offset, size_t length);
3695
3774
  V8_INLINE static Float32Array* Cast(Value* obj);
3696
3775
 
@@ -3706,9 +3785,9 @@ class V8_EXPORT Float32Array : public TypedArray {
3706
3785
  */
3707
3786
  class V8_EXPORT Float64Array : public TypedArray {
3708
3787
  public:
3709
- static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer,
3710
- size_t byte_offset, size_t length);
3711
- static Local<Float64Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
3788
+ static Local<Float64Array> New(Local<ArrayBuffer> array_buffer,
3789
+ size_t byte_offset, size_t length);
3790
+ static Local<Float64Array> New(Local<SharedArrayBuffer> shared_array_buffer,
3712
3791
  size_t byte_offset, size_t length);
3713
3792
  V8_INLINE static Float64Array* Cast(Value* obj);
3714
3793
 
@@ -3724,9 +3803,9 @@ class V8_EXPORT Float64Array : public TypedArray {
3724
3803
  */
3725
3804
  class V8_EXPORT DataView : public ArrayBufferView {
3726
3805
  public:
3727
- static Local<DataView> New(Handle<ArrayBuffer> array_buffer,
3806
+ static Local<DataView> New(Local<ArrayBuffer> array_buffer,
3728
3807
  size_t byte_offset, size_t length);
3729
- static Local<DataView> New(Handle<SharedArrayBuffer> shared_array_buffer,
3808
+ static Local<DataView> New(Local<SharedArrayBuffer> shared_array_buffer,
3730
3809
  size_t byte_offset, size_t length);
3731
3810
  V8_INLINE static DataView* Cast(Value* obj);
3732
3811
 
@@ -3893,7 +3972,8 @@ class V8_EXPORT NumberObject : public Object {
3893
3972
  */
3894
3973
  class V8_EXPORT BooleanObject : public Object {
3895
3974
  public:
3896
- static Local<Value> New(bool value);
3975
+ static Local<Value> New(Isolate* isolate, bool value);
3976
+ V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
3897
3977
 
3898
3978
  bool ValueOf() const;
3899
3979
 
@@ -3909,7 +3989,7 @@ class V8_EXPORT BooleanObject : public Object {
3909
3989
  */
3910
3990
  class V8_EXPORT StringObject : public Object {
3911
3991
  public:
3912
- static Local<Value> New(Handle<String> value);
3992
+ static Local<Value> New(Local<String> value);
3913
3993
 
3914
3994
  Local<String> ValueOf() const;
3915
3995
 
@@ -3927,7 +4007,7 @@ class V8_EXPORT StringObject : public Object {
3927
4007
  */
3928
4008
  class V8_EXPORT SymbolObject : public Object {
3929
4009
  public:
3930
- static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
4010
+ static Local<Value> New(Isolate* isolate, Local<Symbol> value);
3931
4011
 
3932
4012
  Local<Symbol> ValueOf() const;
3933
4013
 
@@ -3951,7 +4031,9 @@ class V8_EXPORT RegExp : public Object {
3951
4031
  kNone = 0,
3952
4032
  kGlobal = 1,
3953
4033
  kIgnoreCase = 2,
3954
- kMultiline = 4
4034
+ kMultiline = 4,
4035
+ kSticky = 8,
4036
+ kUnicode = 16
3955
4037
  };
3956
4038
 
3957
4039
  /**
@@ -3965,10 +4047,10 @@ class V8_EXPORT RegExp : public Object {
3965
4047
  * is equivalent to evaluating "/foo/gm".
3966
4048
  */
3967
4049
  static V8_DEPRECATE_SOON("Use maybe version",
3968
- Local<RegExp> New(Handle<String> pattern,
4050
+ Local<RegExp> New(Local<String> pattern,
3969
4051
  Flags flags));
3970
4052
  static V8_WARN_UNUSED_RESULT MaybeLocal<RegExp> New(Local<Context> context,
3971
- Handle<String> pattern,
4053
+ Local<String> pattern,
3972
4054
  Flags flags);
3973
4055
 
3974
4056
  /**
@@ -4003,6 +4085,15 @@ class V8_EXPORT External : public Value {
4003
4085
  };
4004
4086
 
4005
4087
 
4088
+ #define V8_INTRINSICS_LIST(F) F(ArrayProto_values, array_values_iterator)
4089
+
4090
+ enum Intrinsic {
4091
+ #define V8_DECL_INTRINSIC(name, iname) k##name,
4092
+ V8_INTRINSICS_LIST(V8_DECL_INTRINSIC)
4093
+ #undef V8_DECL_INTRINSIC
4094
+ };
4095
+
4096
+
4006
4097
  // --- Templates ---
4007
4098
 
4008
4099
 
@@ -4012,9 +4103,9 @@ class V8_EXPORT External : public Value {
4012
4103
  class V8_EXPORT Template : public Data {
4013
4104
  public:
4014
4105
  /** Adds a property to each instance created by this template.*/
4015
- void Set(Handle<Name> name, Handle<Data> value,
4106
+ void Set(Local<Name> name, Local<Data> value,
4016
4107
  PropertyAttribute attributes = None);
4017
- V8_INLINE void Set(Isolate* isolate, const char* name, Handle<Data> value);
4108
+ V8_INLINE void Set(Isolate* isolate, const char* name, Local<Data> value);
4018
4109
 
4019
4110
  void SetAccessorProperty(
4020
4111
  Local<Name> name,
@@ -4050,24 +4141,27 @@ class V8_EXPORT Template : public Data {
4050
4141
  * defined by FunctionTemplate::HasInstance()), an implicit TypeError is
4051
4142
  * thrown and no callback is invoked.
4052
4143
  */
4053
- void SetNativeDataProperty(Local<String> name,
4054
- AccessorGetterCallback getter,
4055
- AccessorSetterCallback setter = 0,
4056
- // TODO(dcarney): gcc can't handle Local below
4057
- Handle<Value> data = Handle<Value>(),
4058
- PropertyAttribute attribute = None,
4059
- Local<AccessorSignature> signature =
4060
- Local<AccessorSignature>(),
4061
- AccessControl settings = DEFAULT);
4062
- void SetNativeDataProperty(Local<Name> name,
4063
- AccessorNameGetterCallback getter,
4064
- AccessorNameSetterCallback setter = 0,
4065
- // TODO(dcarney): gcc can't handle Local below
4066
- Handle<Value> data = Handle<Value>(),
4067
- PropertyAttribute attribute = None,
4068
- Local<AccessorSignature> signature =
4069
- Local<AccessorSignature>(),
4070
- AccessControl settings = DEFAULT);
4144
+ void SetNativeDataProperty(
4145
+ Local<String> name, AccessorGetterCallback getter,
4146
+ AccessorSetterCallback setter = 0,
4147
+ // TODO(dcarney): gcc can't handle Local below
4148
+ Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
4149
+ Local<AccessorSignature> signature = Local<AccessorSignature>(),
4150
+ AccessControl settings = DEFAULT);
4151
+ void SetNativeDataProperty(
4152
+ Local<Name> name, AccessorNameGetterCallback getter,
4153
+ AccessorNameSetterCallback setter = 0,
4154
+ // TODO(dcarney): gcc can't handle Local below
4155
+ Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
4156
+ Local<AccessorSignature> signature = Local<AccessorSignature>(),
4157
+ AccessControl settings = DEFAULT);
4158
+
4159
+ /**
4160
+ * During template instantiation, sets the value with the intrinsic property
4161
+ * from the correct context.
4162
+ */
4163
+ void SetIntrinsicDataProperty(Local<Name> name, Intrinsic intrinsic,
4164
+ PropertyAttribute attribute = None);
4071
4165
 
4072
4166
  private:
4073
4167
  Template();
@@ -4227,6 +4321,16 @@ enum AccessType {
4227
4321
  };
4228
4322
 
4229
4323
 
4324
+ /**
4325
+ * Returns true if the given context should be allowed to access the given
4326
+ * object.
4327
+ */
4328
+ typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
4329
+ Local<Object> accessed_object,
4330
+ Local<Value> data);
4331
+ typedef bool (*DeprecatedAccessCheckCallback)(Local<Context> accessing_context,
4332
+ Local<Object> accessed_object);
4333
+
4230
4334
  /**
4231
4335
  * Returns true if cross-context access should be allowed to the named
4232
4336
  * property with the given key on the host object.
@@ -4346,11 +4450,19 @@ class V8_EXPORT FunctionTemplate : public Template {
4346
4450
  public:
4347
4451
  /** Creates a function template.*/
4348
4452
  static Local<FunctionTemplate> New(
4349
- Isolate* isolate,
4350
- FunctionCallback callback = 0,
4351
- Handle<Value> data = Handle<Value>(),
4352
- Handle<Signature> signature = Handle<Signature>(),
4353
- int length = 0);
4453
+ Isolate* isolate, FunctionCallback callback = 0,
4454
+ Local<Value> data = Local<Value>(),
4455
+ Local<Signature> signature = Local<Signature>(), int length = 0);
4456
+
4457
+ /**
4458
+ * Creates a function template with a fast handler. If a fast handler is set,
4459
+ * the callback cannot be null.
4460
+ */
4461
+ static Local<FunctionTemplate> NewWithFastHandler(
4462
+ Isolate* isolate, FunctionCallback callback,
4463
+ experimental::FastAccessorBuilder* fast_handler = nullptr,
4464
+ Local<Value> data = Local<Value>(),
4465
+ Local<Signature> signature = Local<Signature>(), int length = 0);
4354
4466
 
4355
4467
  /** Returns the unique function instance in the current execution context.*/
4356
4468
  V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction());
@@ -4362,8 +4474,9 @@ class V8_EXPORT FunctionTemplate : public Template {
4362
4474
  * callback is called whenever the function created from this
4363
4475
  * FunctionTemplate is called.
4364
4476
  */
4365
- void SetCallHandler(FunctionCallback callback,
4366
- Handle<Value> data = Handle<Value>());
4477
+ void SetCallHandler(
4478
+ FunctionCallback callback, Local<Value> data = Local<Value>(),
4479
+ experimental::FastAccessorBuilder* fast_handler = nullptr);
4367
4480
 
4368
4481
  /** Set the predefined length property for the FunctionTemplate. */
4369
4482
  void SetLength(int length);
@@ -4372,7 +4485,7 @@ class V8_EXPORT FunctionTemplate : public Template {
4372
4485
  Local<ObjectTemplate> InstanceTemplate();
4373
4486
 
4374
4487
  /** Causes the function template to inherit from a parent function template.*/
4375
- void Inherit(Handle<FunctionTemplate> parent);
4488
+ void Inherit(Local<FunctionTemplate> parent);
4376
4489
 
4377
4490
  /**
4378
4491
  * A PrototypeTemplate is the template used to create the prototype object
@@ -4385,7 +4498,7 @@ class V8_EXPORT FunctionTemplate : public Template {
4385
4498
  * printing objects created with the function created from the
4386
4499
  * FunctionTemplate as its constructor.
4387
4500
  */
4388
- void SetClassName(Handle<String> name);
4501
+ void SetClassName(Local<String> name);
4389
4502
 
4390
4503
 
4391
4504
  /**
@@ -4424,7 +4537,7 @@ class V8_EXPORT FunctionTemplate : public Template {
4424
4537
  * Returns true if the given object is an instance of this function
4425
4538
  * template.
4426
4539
  */
4427
- bool HasInstance(Handle<Value> object);
4540
+ bool HasInstance(Local<Value> object);
4428
4541
 
4429
4542
  private:
4430
4543
  FunctionTemplate();
@@ -4454,7 +4567,7 @@ struct NamedPropertyHandlerConfiguration {
4454
4567
  GenericNamedPropertyQueryCallback query = 0,
4455
4568
  GenericNamedPropertyDeleterCallback deleter = 0,
4456
4569
  GenericNamedPropertyEnumeratorCallback enumerator = 0,
4457
- Handle<Value> data = Handle<Value>(),
4570
+ Local<Value> data = Local<Value>(),
4458
4571
  PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
4459
4572
  : getter(getter),
4460
4573
  setter(setter),
@@ -4469,7 +4582,7 @@ struct NamedPropertyHandlerConfiguration {
4469
4582
  GenericNamedPropertyQueryCallback query;
4470
4583
  GenericNamedPropertyDeleterCallback deleter;
4471
4584
  GenericNamedPropertyEnumeratorCallback enumerator;
4472
- Handle<Value> data;
4585
+ Local<Value> data;
4473
4586
  PropertyHandlerFlags flags;
4474
4587
  };
4475
4588
 
@@ -4482,7 +4595,7 @@ struct IndexedPropertyHandlerConfiguration {
4482
4595
  IndexedPropertyQueryCallback query = 0,
4483
4596
  IndexedPropertyDeleterCallback deleter = 0,
4484
4597
  IndexedPropertyEnumeratorCallback enumerator = 0,
4485
- Handle<Value> data = Handle<Value>(),
4598
+ Local<Value> data = Local<Value>(),
4486
4599
  PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
4487
4600
  : getter(getter),
4488
4601
  setter(setter),
@@ -4497,7 +4610,7 @@ struct IndexedPropertyHandlerConfiguration {
4497
4610
  IndexedPropertyQueryCallback query;
4498
4611
  IndexedPropertyDeleterCallback deleter;
4499
4612
  IndexedPropertyEnumeratorCallback enumerator;
4500
- Handle<Value> data;
4613
+ Local<Value> data;
4501
4614
  PropertyHandlerFlags flags;
4502
4615
  };
4503
4616
 
@@ -4513,8 +4626,8 @@ class V8_EXPORT ObjectTemplate : public Template {
4513
4626
  /** Creates an ObjectTemplate. */
4514
4627
  static Local<ObjectTemplate> New(
4515
4628
  Isolate* isolate,
4516
- Handle<FunctionTemplate> constructor = Handle<FunctionTemplate>());
4517
- static V8_DEPRECATE_SOON("Use isolate version", Local<ObjectTemplate> New());
4629
+ Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
4630
+ static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
4518
4631
 
4519
4632
  /** Creates a new instance of this template.*/
4520
4633
  V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance());
@@ -4549,22 +4662,16 @@ class V8_EXPORT ObjectTemplate : public Template {
4549
4662
  * defined by FunctionTemplate::HasInstance()), an implicit TypeError is
4550
4663
  * thrown and no callback is invoked.
4551
4664
  */
4552
- void SetAccessor(Handle<String> name,
4553
- AccessorGetterCallback getter,
4554
- AccessorSetterCallback setter = 0,
4555
- Handle<Value> data = Handle<Value>(),
4556
- AccessControl settings = DEFAULT,
4557
- PropertyAttribute attribute = None,
4558
- Handle<AccessorSignature> signature =
4559
- Handle<AccessorSignature>());
4560
- void SetAccessor(Handle<Name> name,
4561
- AccessorNameGetterCallback getter,
4562
- AccessorNameSetterCallback setter = 0,
4563
- Handle<Value> data = Handle<Value>(),
4564
- AccessControl settings = DEFAULT,
4565
- PropertyAttribute attribute = None,
4566
- Handle<AccessorSignature> signature =
4567
- Handle<AccessorSignature>());
4665
+ void SetAccessor(
4666
+ Local<String> name, AccessorGetterCallback getter,
4667
+ AccessorSetterCallback setter = 0, Local<Value> data = Local<Value>(),
4668
+ AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
4669
+ Local<AccessorSignature> signature = Local<AccessorSignature>());
4670
+ void SetAccessor(
4671
+ Local<Name> name, AccessorNameGetterCallback getter,
4672
+ AccessorNameSetterCallback setter = 0, Local<Value> data = Local<Value>(),
4673
+ AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
4674
+ Local<AccessorSignature> signature = Local<AccessorSignature>());
4568
4675
 
4569
4676
  /**
4570
4677
  * Sets a named property handler on the object template.
@@ -4587,13 +4694,12 @@ class V8_EXPORT ObjectTemplate : public Template {
4587
4694
  * whenever they are invoked.
4588
4695
  */
4589
4696
  // TODO(dcarney): deprecate
4590
- void SetNamedPropertyHandler(
4591
- NamedPropertyGetterCallback getter,
4592
- NamedPropertySetterCallback setter = 0,
4593
- NamedPropertyQueryCallback query = 0,
4594
- NamedPropertyDeleterCallback deleter = 0,
4595
- NamedPropertyEnumeratorCallback enumerator = 0,
4596
- Handle<Value> data = Handle<Value>());
4697
+ void SetNamedPropertyHandler(NamedPropertyGetterCallback getter,
4698
+ NamedPropertySetterCallback setter = 0,
4699
+ NamedPropertyQueryCallback query = 0,
4700
+ NamedPropertyDeleterCallback deleter = 0,
4701
+ NamedPropertyEnumeratorCallback enumerator = 0,
4702
+ Local<Value> data = Local<Value>());
4597
4703
  void SetHandler(const NamedPropertyHandlerConfiguration& configuration);
4598
4704
 
4599
4705
  /**
@@ -4620,7 +4726,7 @@ class V8_EXPORT ObjectTemplate : public Template {
4620
4726
  IndexedPropertyQueryCallback query = 0,
4621
4727
  IndexedPropertyDeleterCallback deleter = 0,
4622
4728
  IndexedPropertyEnumeratorCallback enumerator = 0,
4623
- Handle<Value> data = Handle<Value>()) {
4729
+ Local<Value> data = Local<Value>()) {
4624
4730
  SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query,
4625
4731
  deleter, enumerator, data));
4626
4732
  }
@@ -4631,7 +4737,7 @@ class V8_EXPORT ObjectTemplate : public Template {
4631
4737
  * function.
4632
4738
  */
4633
4739
  void SetCallAsFunctionHandler(FunctionCallback callback,
4634
- Handle<Value> data = Handle<Value>());
4740
+ Local<Value> data = Local<Value>());
4635
4741
 
4636
4742
  /**
4637
4743
  * Mark object instances of the template as undetectable.
@@ -4644,16 +4750,25 @@ class V8_EXPORT ObjectTemplate : public Template {
4644
4750
  void MarkAsUndetectable();
4645
4751
 
4646
4752
  /**
4647
- * Sets access check callbacks on the object template and enables
4648
- * access checks.
4753
+ * Sets access check callback on the object template and enables access
4754
+ * checks.
4649
4755
  *
4650
4756
  * When accessing properties on instances of this object template,
4651
4757
  * the access check callback will be called to determine whether or
4652
4758
  * not to allow cross-context access to the properties.
4653
4759
  */
4654
- void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
4655
- IndexedSecurityCallback indexed_handler,
4656
- Handle<Value> data = Handle<Value>());
4760
+ void SetAccessCheckCallback(AccessCheckCallback callback,
4761
+ Local<Value> data = Local<Value>());
4762
+ V8_DEPRECATED(
4763
+ "Use SetAccessCheckCallback with new AccessCheckCallback signature.",
4764
+ void SetAccessCheckCallback(DeprecatedAccessCheckCallback callback,
4765
+ Local<Value> data = Local<Value>()));
4766
+
4767
+ V8_DEPRECATED(
4768
+ "Use SetAccessCheckCallback instead",
4769
+ void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
4770
+ IndexedSecurityCallback indexed_handler,
4771
+ Local<Value> data = Local<Value>()));
4657
4772
 
4658
4773
  /**
4659
4774
  * Gets the number of internal fields for objects generated from
@@ -4670,7 +4785,7 @@ class V8_EXPORT ObjectTemplate : public Template {
4670
4785
  private:
4671
4786
  ObjectTemplate();
4672
4787
  static Local<ObjectTemplate> New(internal::Isolate* isolate,
4673
- Handle<FunctionTemplate> constructor);
4788
+ Local<FunctionTemplate> constructor);
4674
4789
  friend class FunctionTemplate;
4675
4790
  };
4676
4791
 
@@ -4682,7 +4797,7 @@ class V8_EXPORT Signature : public Data {
4682
4797
  public:
4683
4798
  static Local<Signature> New(
4684
4799
  Isolate* isolate,
4685
- Handle<FunctionTemplate> receiver = Handle<FunctionTemplate>());
4800
+ Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
4686
4801
 
4687
4802
  private:
4688
4803
  Signature();
@@ -4695,29 +4810,15 @@ class V8_EXPORT Signature : public Data {
4695
4810
  */
4696
4811
  class V8_EXPORT AccessorSignature : public Data {
4697
4812
  public:
4698
- static Local<AccessorSignature> New(Isolate* isolate,
4699
- Handle<FunctionTemplate> receiver =
4700
- Handle<FunctionTemplate>());
4813
+ static Local<AccessorSignature> New(
4814
+ Isolate* isolate,
4815
+ Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
4701
4816
 
4702
4817
  private:
4703
4818
  AccessorSignature();
4704
4819
  };
4705
4820
 
4706
4821
 
4707
- /**
4708
- * A utility for determining the type of objects based on the template
4709
- * they were constructed from.
4710
- */
4711
- class V8_EXPORT TypeSwitch : public Data {
4712
- public:
4713
- static Local<TypeSwitch> New(Handle<FunctionTemplate> type);
4714
- static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]);
4715
- int match(Handle<Value> value);
4716
- private:
4717
- TypeSwitch();
4718
- };
4719
-
4720
-
4721
4822
  // --- Extensions ---
4722
4823
 
4723
4824
  class V8_EXPORT ExternalOneByteStringResourceImpl
@@ -4747,9 +4848,9 @@ class V8_EXPORT Extension { // NOLINT
4747
4848
  const char** deps = 0,
4748
4849
  int source_length = -1);
4749
4850
  virtual ~Extension() { }
4750
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
4751
- v8::Isolate* isolate, v8::Handle<v8::String> name) {
4752
- return v8::Handle<v8::FunctionTemplate>();
4851
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
4852
+ v8::Isolate* isolate, v8::Local<v8::String> name) {
4853
+ return v8::Local<v8::FunctionTemplate>();
4753
4854
  }
4754
4855
 
4755
4856
  const char* name() const { return name_; }
@@ -4780,10 +4881,10 @@ void V8_EXPORT RegisterExtension(Extension* extension);
4780
4881
 
4781
4882
  // --- Statics ---
4782
4883
 
4783
- V8_INLINE Handle<Primitive> Undefined(Isolate* isolate);
4784
- V8_INLINE Handle<Primitive> Null(Isolate* isolate);
4785
- V8_INLINE Handle<Boolean> True(Isolate* isolate);
4786
- V8_INLINE Handle<Boolean> False(Isolate* isolate);
4884
+ V8_INLINE Local<Primitive> Undefined(Isolate* isolate);
4885
+ V8_INLINE Local<Primitive> Null(Isolate* isolate);
4886
+ V8_INLINE Local<Boolean> True(Isolate* isolate);
4887
+ V8_INLINE Local<Boolean> False(Isolate* isolate);
4787
4888
 
4788
4889
 
4789
4890
  /**
@@ -4811,12 +4912,6 @@ class V8_EXPORT ResourceConstraints {
4811
4912
  void ConfigureDefaults(uint64_t physical_memory,
4812
4913
  uint64_t virtual_memory_limit);
4813
4914
 
4814
- // Deprecated, will be removed soon.
4815
- V8_DEPRECATED("Use two-args version instead",
4816
- void ConfigureDefaults(uint64_t physical_memory,
4817
- uint64_t virtual_memory_limit,
4818
- uint32_t number_of_processors));
4819
-
4820
4915
  int max_semi_space_size() const { return max_semi_space_size_; }
4821
4916
  void set_max_semi_space_size(int value) { max_semi_space_size_ = value; }
4822
4917
  int max_old_space_size() const { return max_old_space_size_; }
@@ -4826,14 +4921,6 @@ class V8_EXPORT ResourceConstraints {
4826
4921
  uint32_t* stack_limit() const { return stack_limit_; }
4827
4922
  // Sets an address beyond which the VM's stack may not grow.
4828
4923
  void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
4829
- V8_DEPRECATED("Unused, will be removed", int max_available_threads() const) {
4830
- return max_available_threads_;
4831
- }
4832
- // Set the number of threads available to V8, assuming at least 1.
4833
- V8_DEPRECATED("Unused, will be removed",
4834
- void set_max_available_threads(int value)) {
4835
- max_available_threads_ = value;
4836
- }
4837
4924
  size_t code_range_size() const { return code_range_size_; }
4838
4925
  void set_code_range_size(size_t value) {
4839
4926
  code_range_size_ = value;
@@ -4844,7 +4931,6 @@ class V8_EXPORT ResourceConstraints {
4844
4931
  int max_old_space_size_;
4845
4932
  int max_executable_size_;
4846
4933
  uint32_t* stack_limit_;
4847
- int max_available_threads_;
4848
4934
  size_t code_range_size_;
4849
4935
  };
4850
4936
 
@@ -4855,7 +4941,7 @@ class V8_EXPORT ResourceConstraints {
4855
4941
  typedef void (*FatalErrorCallback)(const char* location, const char* message);
4856
4942
 
4857
4943
 
4858
- typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);
4944
+ typedef void (*MessageCallback)(Local<Message> message, Local<Value> error);
4859
4945
 
4860
4946
  // --- Tracing ---
4861
4947
 
@@ -4867,24 +4953,26 @@ typedef void (*LogEventCallback)(const char* name, int event);
4867
4953
  */
4868
4954
  class V8_EXPORT Exception {
4869
4955
  public:
4870
- static Local<Value> RangeError(Handle<String> message);
4871
- static Local<Value> ReferenceError(Handle<String> message);
4872
- static Local<Value> SyntaxError(Handle<String> message);
4873
- static Local<Value> TypeError(Handle<String> message);
4874
- static Local<Value> Error(Handle<String> message);
4956
+ static Local<Value> RangeError(Local<String> message);
4957
+ static Local<Value> ReferenceError(Local<String> message);
4958
+ static Local<Value> SyntaxError(Local<String> message);
4959
+ static Local<Value> TypeError(Local<String> message);
4960
+ static Local<Value> Error(Local<String> message);
4875
4961
 
4876
4962
  /**
4877
4963
  * Creates an error message for the given exception.
4878
4964
  * Will try to reconstruct the original stack trace from the exception value,
4879
4965
  * or capture the current stack trace if not available.
4880
4966
  */
4881
- static Local<Message> CreateMessage(Handle<Value> exception);
4967
+ static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception);
4968
+ V8_DEPRECATED("Use version with an Isolate*",
4969
+ static Local<Message> CreateMessage(Local<Value> exception));
4882
4970
 
4883
4971
  /**
4884
4972
  * Returns the original stack trace that was captured at the creation time
4885
4973
  * of a given exception, or an empty handle if not available.
4886
4974
  */
4887
- static Local<StackTrace> GetStackTrace(Handle<Value> exception);
4975
+ static Local<StackTrace> GetStackTrace(Local<Value> exception);
4888
4976
  };
4889
4977
 
4890
4978
 
@@ -4921,8 +5009,10 @@ typedef void (*MemoryAllocationCallback)(ObjectSpace space,
4921
5009
  AllocationAction action,
4922
5010
  int size);
4923
5011
 
4924
- // --- Leave Script Callback ---
4925
- typedef void (*CallCompletedCallback)();
5012
+ // --- Enter/Leave Script Callback ---
5013
+ typedef void (*BeforeCallEnteredCallback)(Isolate*);
5014
+ typedef void (*CallCompletedCallback)(Isolate*);
5015
+ typedef void (*DeprecatedCallCompletedCallback)();
4926
5016
 
4927
5017
  // --- Promise Reject Callback ---
4928
5018
  enum PromiseRejectEvent {
@@ -4932,25 +5022,27 @@ enum PromiseRejectEvent {
4932
5022
 
4933
5023
  class PromiseRejectMessage {
4934
5024
  public:
4935
- PromiseRejectMessage(Handle<Promise> promise, PromiseRejectEvent event,
4936
- Handle<Value> value, Handle<StackTrace> stack_trace)
5025
+ PromiseRejectMessage(Local<Promise> promise, PromiseRejectEvent event,
5026
+ Local<Value> value, Local<StackTrace> stack_trace)
4937
5027
  : promise_(promise),
4938
5028
  event_(event),
4939
5029
  value_(value),
4940
5030
  stack_trace_(stack_trace) {}
4941
5031
 
4942
- V8_INLINE Handle<Promise> GetPromise() const { return promise_; }
5032
+ V8_INLINE Local<Promise> GetPromise() const { return promise_; }
4943
5033
  V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
4944
- V8_INLINE Handle<Value> GetValue() const { return value_; }
5034
+ V8_INLINE Local<Value> GetValue() const { return value_; }
4945
5035
 
4946
- // DEPRECATED. Use v8::Exception::CreateMessage(GetValue())->GetStackTrace()
4947
- V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; }
5036
+ V8_DEPRECATED("Use v8::Exception::CreateMessage(GetValue())->GetStackTrace()",
5037
+ V8_INLINE Local<StackTrace> GetStackTrace() const) {
5038
+ return stack_trace_;
5039
+ }
4948
5040
 
4949
5041
  private:
4950
- Handle<Promise> promise_;
5042
+ Local<Promise> promise_;
4951
5043
  PromiseRejectEvent event_;
4952
- Handle<Value> value_;
4953
- Handle<StackTrace> stack_trace_;
5044
+ Local<Value> value_;
5045
+ Local<StackTrace> stack_trace_;
4954
5046
  };
4955
5047
 
4956
5048
  typedef void (*PromiseRejectCallback)(PromiseRejectMessage message);
@@ -4974,27 +5066,42 @@ typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context);
4974
5066
  // --- Garbage Collection Callbacks ---
4975
5067
 
4976
5068
  /**
4977
- * Applications can register callback functions which will be called
4978
- * before and after a garbage collection. Allocations are not
4979
- * allowed in the callback functions, you therefore cannot manipulate
4980
- * objects (set or delete properties for example) since it is possible
4981
- * such operations will result in the allocation of objects.
5069
+ * Applications can register callback functions which will be called before and
5070
+ * after certain garbage collection operations. Allocations are not allowed in
5071
+ * the callback functions, you therefore cannot manipulate objects (set or
5072
+ * delete properties for example) since it is possible such operations will
5073
+ * result in the allocation of objects.
4982
5074
  */
4983
5075
  enum GCType {
4984
5076
  kGCTypeScavenge = 1 << 0,
4985
5077
  kGCTypeMarkSweepCompact = 1 << 1,
4986
- kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact
5078
+ kGCTypeIncrementalMarking = 1 << 2,
5079
+ kGCTypeProcessWeakCallbacks = 1 << 3,
5080
+ kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact |
5081
+ kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks
4987
5082
  };
4988
5083
 
5084
+ /**
5085
+ * GCCallbackFlags is used to notify additional information about the GC
5086
+ * callback.
5087
+ * - kGCCallbackFlagConstructRetainedObjectInfos: The GC callback is for
5088
+ * constructing retained object infos.
5089
+ * - kGCCallbackFlagForced: The GC callback is for a forced GC for testing.
5090
+ * - kGCCallbackFlagSynchronousPhantomCallbackProcessing: The GC callback
5091
+ * is called synchronously without getting posted to an idle task.
5092
+ * - kGCCallbackFlagCollectAllAvailableGarbage: The GC callback is called
5093
+ * in a phase where V8 is trying to collect all available garbage
5094
+ * (e.g., handling a low memory notification).
5095
+ */
4989
5096
  enum GCCallbackFlags {
4990
5097
  kNoGCCallbackFlags = 0,
4991
- kGCCallbackFlagCompacted = 1 << 0,
4992
5098
  kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1,
4993
- kGCCallbackFlagForced = 1 << 2
5099
+ kGCCallbackFlagForced = 1 << 2,
5100
+ kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3,
5101
+ kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4,
4994
5102
  };
4995
5103
 
4996
- typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags);
4997
- typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags);
5104
+ typedef void (*GCCallback)(GCType type, GCCallbackFlags flags);
4998
5105
 
4999
5106
  typedef void (*InterruptCallback)(Isolate* isolate, void* data);
5000
5107
 
@@ -5014,6 +5121,7 @@ class V8_EXPORT HeapStatistics {
5014
5121
  size_t total_available_size() { return total_available_size_; }
5015
5122
  size_t used_heap_size() { return used_heap_size_; }
5016
5123
  size_t heap_size_limit() { return heap_size_limit_; }
5124
+ size_t does_zap_garbage() { return does_zap_garbage_; }
5017
5125
 
5018
5126
  private:
5019
5127
  size_t total_heap_size_;
@@ -5022,6 +5130,7 @@ class V8_EXPORT HeapStatistics {
5022
5130
  size_t total_available_size_;
5023
5131
  size_t used_heap_size_;
5024
5132
  size_t heap_size_limit_;
5133
+ bool does_zap_garbage_;
5025
5134
 
5026
5135
  friend class V8;
5027
5136
  friend class Isolate;
@@ -5111,7 +5220,7 @@ struct JitCodeEvent {
5111
5220
  // Size of the instructions.
5112
5221
  size_t code_len;
5113
5222
  // Script info for CODE_ADDED event.
5114
- Handle<UnboundScript> script;
5223
+ Local<UnboundScript> script;
5115
5224
  // User-defined data for *_LINE_INFO_* event. It's used to hold the source
5116
5225
  // code line information which is returned from the
5117
5226
  // CODE_START_LINE_INFO_RECORDING event. And it's passed to subsequent
@@ -5171,7 +5280,7 @@ typedef void (*JitCodeEventHandler)(const JitCodeEvent* event);
5171
5280
  class V8_EXPORT ExternalResourceVisitor { // NOLINT
5172
5281
  public:
5173
5282
  virtual ~ExternalResourceVisitor() {}
5174
- virtual void VisitExternalString(Handle<String> string) {}
5283
+ virtual void VisitExternalString(Local<String> string) {}
5175
5284
  };
5176
5285
 
5177
5286
 
@@ -5359,6 +5468,30 @@ class V8_EXPORT Isolate {
5359
5468
  kSlotsBufferOverflow = 5,
5360
5469
  kObjectObserve = 6,
5361
5470
  kForcedGC = 7,
5471
+ kSloppyMode = 8,
5472
+ kStrictMode = 9,
5473
+ kStrongMode = 10,
5474
+ kRegExpPrototypeStickyGetter = 11,
5475
+ kRegExpPrototypeToString = 12,
5476
+ kRegExpPrototypeUnicodeGetter = 13,
5477
+ kIntlV8Parse = 14,
5478
+ kIntlPattern = 15,
5479
+ kIntlResolved = 16,
5480
+ kPromiseChain = 17,
5481
+ kPromiseAccept = 18,
5482
+ kPromiseDefer = 19,
5483
+ kHtmlCommentInExternalScript = 20,
5484
+ kHtmlComment = 21,
5485
+ kSloppyModeBlockScopedFunctionRedefinition = 22,
5486
+ kForInInitializer = 23,
5487
+ kArrayProtectorDirtied = 24,
5488
+ kArraySpeciesModified = 25,
5489
+ kArrayPrototypeConstructorModified = 26,
5490
+ kArrayInstanceProtoModified = 27,
5491
+ kArrayInstanceConstructorModified = 28,
5492
+
5493
+ // If you add new values here, you'll also need to update V8Initializer.cpp
5494
+ // in Chromium.
5362
5495
  kUseCounterFeatureCount // This enum value must be last.
5363
5496
  };
5364
5497
 
@@ -5377,8 +5510,6 @@ class V8_EXPORT Isolate {
5377
5510
  */
5378
5511
  static Isolate* New(const CreateParams& params);
5379
5512
 
5380
- static V8_DEPRECATED("Always pass CreateParams", Isolate* New());
5381
-
5382
5513
  /**
5383
5514
  * Returns the entered isolate for the current thread or NULL in
5384
5515
  * case there is no current isolate.
@@ -5387,6 +5518,19 @@ class V8_EXPORT Isolate {
5387
5518
  */
5388
5519
  static Isolate* GetCurrent();
5389
5520
 
5521
+ /**
5522
+ * Custom callback used by embedders to help V8 determine if it should abort
5523
+ * when it throws and no internal handler is predicted to catch the
5524
+ * exception. If --abort-on-uncaught-exception is used on the command line,
5525
+ * then V8 will abort if either:
5526
+ * - no custom callback is set.
5527
+ * - the custom callback set returns true.
5528
+ * Otherwise, the custom callback will not be called and V8 will not abort.
5529
+ */
5530
+ typedef bool (*AbortOnUncaughtExceptionCallback)(Isolate*);
5531
+ void SetAbortOnUncaughtExceptionCallback(
5532
+ AbortOnUncaughtExceptionCallback callback);
5533
+
5390
5534
  /**
5391
5535
  * Methods below this point require holding a lock (using Locker) in
5392
5536
  * a multi-threaded environment.
@@ -5414,6 +5558,15 @@ class V8_EXPORT Isolate {
5414
5558
  */
5415
5559
  void Dispose();
5416
5560
 
5561
+ /**
5562
+ * Discards all V8 thread-specific data for the Isolate. Should be used
5563
+ * if a thread is terminating and it has used an Isolate that will outlive
5564
+ * the thread -- all thread-specific data for an Isolate is discarded when
5565
+ * an Isolate is disposed so this call is pointless if an Isolate is about
5566
+ * to be Disposed.
5567
+ */
5568
+ void DiscardThreadSpecificMetadata();
5569
+
5417
5570
  /**
5418
5571
  * Associate embedder-specific data with the isolate. |slot| has to be
5419
5572
  * between 0 and GetNumberOfDataSlots() - 1.
@@ -5518,7 +5671,10 @@ class V8_EXPORT Isolate {
5518
5671
  /** Returns true if this isolate has a current context. */
5519
5672
  bool InContext();
5520
5673
 
5521
- /** Returns the context that is on the top of the stack. */
5674
+ /**
5675
+ * Returns the context of the currently running JavaScript, or the context
5676
+ * on the top of the stack if no JavaScript is running.
5677
+ */
5522
5678
  Local<Context> GetCurrentContext();
5523
5679
 
5524
5680
  /**
@@ -5526,9 +5682,12 @@ class V8_EXPORT Isolate {
5526
5682
  * context of the top-most JavaScript frame. If there are no
5527
5683
  * JavaScript frames an empty handle is returned.
5528
5684
  */
5529
- Local<Context> GetCallingContext();
5685
+ V8_DEPRECATE_SOON(
5686
+ "Calling context concept is not compatible with tail calls, and will be "
5687
+ "removed.",
5688
+ Local<Context> GetCallingContext());
5530
5689
 
5531
- /** Returns the last entered context. */
5690
+ /** Returns the last context entered through V8's C++ API. */
5532
5691
  Local<Context> GetEnteredContext();
5533
5692
 
5534
5693
  /**
@@ -5572,12 +5731,8 @@ class V8_EXPORT Isolate {
5572
5731
  template<typename T, typename S>
5573
5732
  void SetReference(const Persistent<T>& parent, const Persistent<S>& child);
5574
5733
 
5575
- typedef void (*GCPrologueCallback)(Isolate* isolate,
5576
- GCType type,
5577
- GCCallbackFlags flags);
5578
- typedef void (*GCEpilogueCallback)(Isolate* isolate,
5579
- GCType type,
5580
- GCCallbackFlags flags);
5734
+ typedef void (*GCCallback)(Isolate* isolate, GCType type,
5735
+ GCCallbackFlags flags);
5581
5736
 
5582
5737
  /**
5583
5738
  * Enables the host application to receive a notification before a
@@ -5588,14 +5743,14 @@ class V8_EXPORT Isolate {
5588
5743
  * not possible to register the same callback function two times with
5589
5744
  * different GCType filters.
5590
5745
  */
5591
- void AddGCPrologueCallback(
5592
- GCPrologueCallback callback, GCType gc_type_filter = kGCTypeAll);
5746
+ void AddGCPrologueCallback(GCCallback callback,
5747
+ GCType gc_type_filter = kGCTypeAll);
5593
5748
 
5594
5749
  /**
5595
5750
  * This function removes callback which was installed by
5596
5751
  * AddGCPrologueCallback function.
5597
5752
  */
5598
- void RemoveGCPrologueCallback(GCPrologueCallback callback);
5753
+ void RemoveGCPrologueCallback(GCCallback callback);
5599
5754
 
5600
5755
  /**
5601
5756
  * Enables the host application to receive a notification after a
@@ -5606,15 +5761,14 @@ class V8_EXPORT Isolate {
5606
5761
  * not possible to register the same callback function two times with
5607
5762
  * different GCType filters.
5608
5763
  */
5609
- void AddGCEpilogueCallback(
5610
- GCEpilogueCallback callback, GCType gc_type_filter = kGCTypeAll);
5764
+ void AddGCEpilogueCallback(GCCallback callback,
5765
+ GCType gc_type_filter = kGCTypeAll);
5611
5766
 
5612
5767
  /**
5613
5768
  * This function removes callback which was installed by
5614
5769
  * AddGCEpilogueCallback function.
5615
5770
  */
5616
- void RemoveGCEpilogueCallback(GCEpilogueCallback callback);
5617
-
5771
+ void RemoveGCEpilogueCallback(GCCallback callback);
5618
5772
 
5619
5773
  /**
5620
5774
  * Forcefully terminate the current thread of JavaScript execution
@@ -5678,6 +5832,19 @@ class V8_EXPORT Isolate {
5678
5832
  */
5679
5833
  void SetEventLogger(LogEventCallback that);
5680
5834
 
5835
+ /**
5836
+ * Adds a callback to notify the host application right before a script
5837
+ * is about to run. If a script re-enters the runtime during executing, the
5838
+ * BeforeCallEnteredCallback is invoked for each re-entrance.
5839
+ * Executing scripts inside the callback will re-trigger the callback.
5840
+ */
5841
+ void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
5842
+
5843
+ /**
5844
+ * Removes callback that was installed by AddBeforeCallEnteredCallback.
5845
+ */
5846
+ void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
5847
+
5681
5848
  /**
5682
5849
  * Adds a callback to notify the host application when a script finished
5683
5850
  * running. If a script re-enters the runtime during executing, the
@@ -5686,12 +5853,18 @@ class V8_EXPORT Isolate {
5686
5853
  * further callbacks.
5687
5854
  */
5688
5855
  void AddCallCompletedCallback(CallCompletedCallback callback);
5856
+ V8_DEPRECATE_SOON(
5857
+ "Use callback with parameter",
5858
+ void AddCallCompletedCallback(DeprecatedCallCompletedCallback callback));
5689
5859
 
5690
5860
  /**
5691
5861
  * Removes callback that was installed by AddCallCompletedCallback.
5692
5862
  */
5693
5863
  void RemoveCallCompletedCallback(CallCompletedCallback callback);
5694
-
5864
+ V8_DEPRECATE_SOON(
5865
+ "Use callback with parameter",
5866
+ void RemoveCallCompletedCallback(
5867
+ DeprecatedCallCompletedCallback callback));
5695
5868
 
5696
5869
  /**
5697
5870
  * Set callback to notify about promise reject with no handler, or
@@ -5708,7 +5881,7 @@ class V8_EXPORT Isolate {
5708
5881
  /**
5709
5882
  * Experimental: Enqueues the callback to the Microtask Work Queue
5710
5883
  */
5711
- void EnqueueMicrotask(Handle<Function> microtask);
5884
+ void EnqueueMicrotask(Local<Function> microtask);
5712
5885
 
5713
5886
  /**
5714
5887
  * Experimental: Enqueues the callback to the Microtask Work Queue
@@ -5763,8 +5936,8 @@ class V8_EXPORT Isolate {
5763
5936
  */
5764
5937
  bool IdleNotificationDeadline(double deadline_in_seconds);
5765
5938
 
5766
- V8_DEPRECATE_SOON("use IdleNotificationDeadline()",
5767
- bool IdleNotification(int idle_time_in_ms));
5939
+ V8_DEPRECATED("use IdleNotificationDeadline()",
5940
+ bool IdleNotification(int idle_time_in_ms));
5768
5941
 
5769
5942
  /**
5770
5943
  * Optional notification that the system is running low on memory.
@@ -5783,6 +5956,18 @@ class V8_EXPORT Isolate {
5783
5956
  */
5784
5957
  int ContextDisposedNotification(bool dependant_context = true);
5785
5958
 
5959
+ /**
5960
+ * Optional notification that the isolate switched to the foreground.
5961
+ * V8 uses these notifications to guide heuristics.
5962
+ */
5963
+ void IsolateInForegroundNotification();
5964
+
5965
+ /**
5966
+ * Optional notification that the isolate switched to the background.
5967
+ * V8 uses these notifications to guide heuristics.
5968
+ */
5969
+ void IsolateInBackgroundNotification();
5970
+
5786
5971
  /**
5787
5972
  * Allows the host application to provide the address of a function that is
5788
5973
  * notified each time code is added, moved or removed.
@@ -5860,7 +6045,7 @@ class V8_EXPORT Isolate {
5860
6045
  * Otherwise, the exception object will be passed to the callback instead.
5861
6046
  */
5862
6047
  bool AddMessageListener(MessageCallback that,
5863
- Handle<Value> data = Handle<Value>());
6048
+ Local<Value> data = Local<Value>());
5864
6049
 
5865
6050
  /**
5866
6051
  * Remove all message listeners from the specified callback function.
@@ -5912,6 +6097,13 @@ class V8_EXPORT Isolate {
5912
6097
  */
5913
6098
  void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor);
5914
6099
 
6100
+ /**
6101
+ * Iterates through all the persistent handles in the current isolate's heap
6102
+ * that have class_ids and are weak to be marked as inactive if there is no
6103
+ * pending activity for the handle.
6104
+ */
6105
+ void VisitWeakHandles(PersistentHandleVisitor* visitor);
6106
+
5915
6107
  private:
5916
6108
  template <class K, class V, class Traits>
5917
6109
  friend class PersistentValueMapBase;
@@ -5926,7 +6118,7 @@ class V8_EXPORT Isolate {
5926
6118
  void SetObjectGroupId(internal::Object** object, UniqueId id);
5927
6119
  void SetReferenceFromGroup(UniqueId id, internal::Object** object);
5928
6120
  void SetReference(internal::Object** parent, internal::Object** child);
5929
- void CollectAllGarbage(const char* gc_reason);
6121
+ void ReportExternalAllocationLimitReached();
5930
6122
  };
5931
6123
 
5932
6124
  class V8_EXPORT StartupData {
@@ -5966,7 +6158,7 @@ typedef uintptr_t (*ReturnAddressLocationResolver)(
5966
6158
  class V8_EXPORT V8 {
5967
6159
  public:
5968
6160
  /** Set the callback to invoke in case of fatal errors. */
5969
- V8_INLINE static V8_DEPRECATE_SOON(
6161
+ V8_INLINE static V8_DEPRECATED(
5970
6162
  "Use isolate version",
5971
6163
  void SetFatalErrorHandler(FatalErrorCallback that));
5972
6164
 
@@ -5974,25 +6166,15 @@ class V8_EXPORT V8 {
5974
6166
  * Set the callback to invoke to check if code generation from
5975
6167
  * strings should be allowed.
5976
6168
  */
5977
- V8_INLINE static V8_DEPRECATE_SOON(
6169
+ V8_INLINE static V8_DEPRECATED(
5978
6170
  "Use isolate version", void SetAllowCodeGenerationFromStringsCallback(
5979
6171
  AllowCodeGenerationFromStringsCallback that));
5980
6172
 
5981
- /**
5982
- * Set allocator to use for ArrayBuffer memory.
5983
- * The allocator should be set only once. The allocator should be set
5984
- * before any code tha uses ArrayBuffers is executed.
5985
- * This allocator is used in all isolates.
5986
- */
5987
- static V8_DEPRECATE_SOON(
5988
- "Use isolate version",
5989
- void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator));
5990
-
5991
6173
  /**
5992
6174
  * Check if V8 is dead and therefore unusable. This is the case after
5993
6175
  * fatal errors such as out-of-memory situations.
5994
6176
  */
5995
- V8_INLINE static V8_DEPRECATE_SOON("no alternative", bool IsDead());
6177
+ V8_INLINE static V8_DEPRECATED("Use isolate version", bool IsDead());
5996
6178
 
5997
6179
  /**
5998
6180
  * Hand startup data to V8, in case the embedder has chosen to build
@@ -6028,22 +6210,22 @@ class V8_EXPORT V8 {
6028
6210
  * If data is specified, it will be passed to the callback when it is called.
6029
6211
  * Otherwise, the exception object will be passed to the callback instead.
6030
6212
  */
6031
- V8_INLINE static V8_DEPRECATE_SOON(
6213
+ V8_INLINE static V8_DEPRECATED(
6032
6214
  "Use isolate version",
6033
6215
  bool AddMessageListener(MessageCallback that,
6034
- Handle<Value> data = Handle<Value>()));
6216
+ Local<Value> data = Local<Value>()));
6035
6217
 
6036
6218
  /**
6037
6219
  * Remove all message listeners from the specified callback function.
6038
6220
  */
6039
- V8_INLINE static V8_DEPRECATE_SOON(
6221
+ V8_INLINE static V8_DEPRECATED(
6040
6222
  "Use isolate version", void RemoveMessageListeners(MessageCallback that));
6041
6223
 
6042
6224
  /**
6043
6225
  * Tells V8 to capture current stack trace when uncaught exception occurs
6044
6226
  * and report it to the message listeners. The option is off by default.
6045
6227
  */
6046
- V8_INLINE static V8_DEPRECATE_SOON(
6228
+ V8_INLINE static V8_DEPRECATED(
6047
6229
  "Use isolate version",
6048
6230
  void SetCaptureStackTraceForUncaughtExceptions(
6049
6231
  bool capture, int frame_limit = 10,
@@ -6065,7 +6247,7 @@ class V8_EXPORT V8 {
6065
6247
  static const char* GetVersion();
6066
6248
 
6067
6249
  /** Callback function for reporting failed access checks.*/
6068
- V8_INLINE static V8_DEPRECATE_SOON(
6250
+ V8_INLINE static V8_DEPRECATED(
6069
6251
  "Use isolate version",
6070
6252
  void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback));
6071
6253
 
@@ -6079,18 +6261,18 @@ class V8_EXPORT V8 {
6079
6261
  * register the same callback function two times with different
6080
6262
  * GCType filters.
6081
6263
  */
6082
- static V8_DEPRECATE_SOON(
6264
+ static V8_DEPRECATED(
6083
6265
  "Use isolate version",
6084
- void AddGCPrologueCallback(GCPrologueCallback callback,
6266
+ void AddGCPrologueCallback(GCCallback callback,
6085
6267
  GCType gc_type_filter = kGCTypeAll));
6086
6268
 
6087
6269
  /**
6088
6270
  * This function removes callback which was installed by
6089
6271
  * AddGCPrologueCallback function.
6090
6272
  */
6091
- V8_INLINE static V8_DEPRECATE_SOON(
6273
+ V8_INLINE static V8_DEPRECATED(
6092
6274
  "Use isolate version",
6093
- void RemoveGCPrologueCallback(GCPrologueCallback callback));
6275
+ void RemoveGCPrologueCallback(GCCallback callback));
6094
6276
 
6095
6277
  /**
6096
6278
  * Enables the host application to receive a notification after a
@@ -6102,24 +6284,24 @@ class V8_EXPORT V8 {
6102
6284
  * register the same callback function two times with different
6103
6285
  * GCType filters.
6104
6286
  */
6105
- static V8_DEPRECATE_SOON(
6287
+ static V8_DEPRECATED(
6106
6288
  "Use isolate version",
6107
- void AddGCEpilogueCallback(GCEpilogueCallback callback,
6289
+ void AddGCEpilogueCallback(GCCallback callback,
6108
6290
  GCType gc_type_filter = kGCTypeAll));
6109
6291
 
6110
6292
  /**
6111
6293
  * This function removes callback which was installed by
6112
6294
  * AddGCEpilogueCallback function.
6113
6295
  */
6114
- V8_INLINE static V8_DEPRECATE_SOON(
6296
+ V8_INLINE static V8_DEPRECATED(
6115
6297
  "Use isolate version",
6116
- void RemoveGCEpilogueCallback(GCEpilogueCallback callback));
6298
+ void RemoveGCEpilogueCallback(GCCallback callback));
6117
6299
 
6118
6300
  /**
6119
6301
  * Enables the host application to provide a mechanism to be notified
6120
6302
  * and perform custom logging when V8 Allocates Executable Memory.
6121
6303
  */
6122
- V8_INLINE static V8_DEPRECATE_SOON(
6304
+ V8_INLINE static V8_DEPRECATED(
6123
6305
  "Use isolate version",
6124
6306
  void AddMemoryAllocationCallback(MemoryAllocationCallback callback,
6125
6307
  ObjectSpace space,
@@ -6128,7 +6310,7 @@ class V8_EXPORT V8 {
6128
6310
  /**
6129
6311
  * Removes callback that was installed by AddMemoryAllocationCallback.
6130
6312
  */
6131
- V8_INLINE static V8_DEPRECATE_SOON(
6313
+ V8_INLINE static V8_DEPRECATED(
6132
6314
  "Use isolate version",
6133
6315
  void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback));
6134
6316
 
@@ -6160,8 +6342,8 @@ class V8_EXPORT V8 {
6160
6342
  *
6161
6343
  * \param isolate The isolate in which to terminate the current JS execution.
6162
6344
  */
6163
- V8_INLINE static V8_DEPRECATE_SOON("Use isolate version",
6164
- void TerminateExecution(Isolate* isolate));
6345
+ V8_INLINE static V8_DEPRECATED("Use isolate version",
6346
+ void TerminateExecution(Isolate* isolate));
6165
6347
 
6166
6348
  /**
6167
6349
  * Is V8 terminating JavaScript execution.
@@ -6173,7 +6355,7 @@ class V8_EXPORT V8 {
6173
6355
  *
6174
6356
  * \param isolate The isolate in which to check.
6175
6357
  */
6176
- V8_INLINE static V8_DEPRECATE_SOON(
6358
+ V8_INLINE static V8_DEPRECATED(
6177
6359
  "Use isolate version",
6178
6360
  bool IsExecutionTerminating(Isolate* isolate = NULL));
6179
6361
 
@@ -6193,7 +6375,7 @@ class V8_EXPORT V8 {
6193
6375
  *
6194
6376
  * \param isolate The isolate in which to resume execution capability.
6195
6377
  */
6196
- V8_INLINE static V8_DEPRECATE_SOON(
6378
+ V8_INLINE static V8_DEPRECATED(
6197
6379
  "Use isolate version", void CancelTerminateExecution(Isolate* isolate));
6198
6380
 
6199
6381
  /**
@@ -6212,15 +6394,15 @@ class V8_EXPORT V8 {
6212
6394
  * heap. GC is not invoked prior to iterating, therefore there is no
6213
6395
  * guarantee that visited objects are still alive.
6214
6396
  */
6215
- V8_INLINE static V8_DEPRECATE_SOON(
6216
- "Use isoalte version",
6397
+ V8_INLINE static V8_DEPRECATED(
6398
+ "Use isolate version",
6217
6399
  void VisitExternalResources(ExternalResourceVisitor* visitor));
6218
6400
 
6219
6401
  /**
6220
6402
  * Iterates through all the persistent handles in the current isolate's heap
6221
6403
  * that have class_ids.
6222
6404
  */
6223
- V8_INLINE static V8_DEPRECATE_SOON(
6405
+ V8_INLINE static V8_DEPRECATED(
6224
6406
  "Use isolate version",
6225
6407
  void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor));
6226
6408
 
@@ -6228,7 +6410,7 @@ class V8_EXPORT V8 {
6228
6410
  * Iterates through all the persistent handles in isolate's heap that have
6229
6411
  * class_ids.
6230
6412
  */
6231
- V8_INLINE static V8_DEPRECATE_SOON(
6413
+ V8_INLINE static V8_DEPRECATED(
6232
6414
  "Use isolate version",
6233
6415
  void VisitHandlesWithClassIds(Isolate* isolate,
6234
6416
  PersistentHandleVisitor* visitor));
@@ -6240,7 +6422,7 @@ class V8_EXPORT V8 {
6240
6422
  * garbage collection but is free to visit an arbitrary superset of these
6241
6423
  * objects.
6242
6424
  */
6243
- V8_INLINE static V8_DEPRECATE_SOON(
6425
+ V8_INLINE static V8_DEPRECATED(
6244
6426
  "Use isolate version",
6245
6427
  void VisitHandlesForPartialDependence(Isolate* isolate,
6246
6428
  PersistentHandleVisitor* visitor));
@@ -6254,6 +6436,25 @@ class V8_EXPORT V8 {
6254
6436
  */
6255
6437
  static bool InitializeICU(const char* icu_data_file = NULL);
6256
6438
 
6439
+ /**
6440
+ * Initialize the external startup data. The embedder only needs to
6441
+ * invoke this method when external startup data was enabled in a build.
6442
+ *
6443
+ * If V8 was compiled with the startup data in an external file, then
6444
+ * V8 needs to be given those external files during startup. There are
6445
+ * three ways to do this:
6446
+ * - InitializeExternalStartupData(const char*)
6447
+ * This will look in the given directory for files "natives_blob.bin"
6448
+ * and "snapshot_blob.bin" - which is what the default build calls them.
6449
+ * - InitializeExternalStartupData(const char*, const char*)
6450
+ * As above, but will directly use the two given file names.
6451
+ * - Call SetNativesDataBlob, SetNativesDataBlob.
6452
+ * This will read the blobs from the given data structures and will
6453
+ * not perform any file IO.
6454
+ */
6455
+ static void InitializeExternalStartupData(const char* directory_path);
6456
+ static void InitializeExternalStartupData(const char* natives_blob,
6457
+ const char* snapshot_blob);
6257
6458
  /**
6258
6459
  * Sets the v8::Platform to use. This should be invoked before V8 is
6259
6460
  * initialized.
@@ -6379,7 +6580,7 @@ class V8_EXPORT TryCatch {
6379
6580
  * all TryCatch blocks should be stack allocated because the memory
6380
6581
  * location itself is compared against JavaScript try/catch blocks.
6381
6582
  */
6382
- V8_DEPRECATE_SOON("Use isolate version", TryCatch());
6583
+ V8_DEPRECATED("Use isolate version", TryCatch());
6383
6584
 
6384
6585
  /**
6385
6586
  * Creates a new try/catch block and registers it with v8. Note that
@@ -6429,7 +6630,7 @@ class V8_EXPORT TryCatch {
6429
6630
  * ReThrow; the caller must return immediately to where the exception
6430
6631
  * is caught.
6431
6632
  */
6432
- Handle<Value> ReThrow();
6633
+ Local<Value> ReThrow();
6433
6634
 
6434
6635
  /**
6435
6636
  * Returns the exception caught by this try/catch block. If no exception has
@@ -6591,22 +6792,21 @@ class V8_EXPORT Context {
6591
6792
  * and only object identify will remain.
6592
6793
  */
6593
6794
  static Local<Context> New(
6594
- Isolate* isolate,
6595
- ExtensionConfiguration* extensions = NULL,
6596
- Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
6597
- Handle<Value> global_object = Handle<Value>());
6795
+ Isolate* isolate, ExtensionConfiguration* extensions = NULL,
6796
+ Local<ObjectTemplate> global_template = Local<ObjectTemplate>(),
6797
+ Local<Value> global_object = Local<Value>());
6598
6798
 
6599
6799
  /**
6600
6800
  * Sets the security token for the context. To access an object in
6601
6801
  * another context, the security tokens must match.
6602
6802
  */
6603
- void SetSecurityToken(Handle<Value> token);
6803
+ void SetSecurityToken(Local<Value> token);
6604
6804
 
6605
6805
  /** Restores the security token to the default value. */
6606
6806
  void UseDefaultSecurityToken();
6607
6807
 
6608
6808
  /** Returns the security token of this context.*/
6609
- Handle<Value> GetSecurityToken();
6809
+ Local<Value> GetSecurityToken();
6610
6810
 
6611
6811
  /**
6612
6812
  * Enter this context. After entering a context, all code compiled
@@ -6640,17 +6840,19 @@ class V8_EXPORT Context {
6640
6840
  V8_INLINE Local<Value> GetEmbedderData(int index);
6641
6841
 
6642
6842
  /**
6643
- * Gets the exports object used by V8 extras. Extra natives get a reference
6644
- * to this object and can use it to export functionality.
6843
+ * Gets the binding object used by V8 extras. Extra natives get a reference
6844
+ * to this object and can use it to "export" functionality by adding
6845
+ * properties. Extra natives can also "import" functionality by accessing
6846
+ * properties added by the embedder using the V8 API.
6645
6847
  */
6646
- Local<Object> GetExtrasExportsObject();
6848
+ Local<Object> GetExtrasBindingObject();
6647
6849
 
6648
6850
  /**
6649
6851
  * Sets the embedder data with the given index, growing the data as
6650
6852
  * needed. Note that index 0 currently has a special meaning for Chrome's
6651
6853
  * debugger.
6652
6854
  */
6653
- void SetEmbedderData(int index, Handle<Value> value);
6855
+ void SetEmbedderData(int index, Local<Value> value);
6654
6856
 
6655
6857
  /**
6656
6858
  * Gets a 2-byte-aligned native pointer from the embedder data with the given
@@ -6693,7 +6895,12 @@ class V8_EXPORT Context {
6693
6895
  * code generation from strings is not allowed and 'eval' or the 'Function'
6694
6896
  * constructor are called.
6695
6897
  */
6696
- void SetErrorMessageForCodeGenerationFromStrings(Handle<String> message);
6898
+ void SetErrorMessageForCodeGenerationFromStrings(Local<String> message);
6899
+
6900
+ /**
6901
+ * Estimate the memory in bytes retained by this context.
6902
+ */
6903
+ size_t EstimatedSize();
6697
6904
 
6698
6905
  /**
6699
6906
  * Stack-allocated class which sets the execution context for all
@@ -6701,13 +6908,13 @@ class V8_EXPORT Context {
6701
6908
  */
6702
6909
  class Scope {
6703
6910
  public:
6704
- explicit V8_INLINE Scope(Handle<Context> context) : context_(context) {
6911
+ explicit V8_INLINE Scope(Local<Context> context) : context_(context) {
6705
6912
  context_->Enter();
6706
6913
  }
6707
6914
  V8_INLINE ~Scope() { context_->Exit(); }
6708
6915
 
6709
6916
  private:
6710
- Handle<Context> context_;
6917
+ Local<Context> context_;
6711
6918
  };
6712
6919
 
6713
6920
  private:
@@ -6942,12 +7149,12 @@ class Internals {
6942
7149
  1 * kApiPointerSize + kApiIntSize;
6943
7150
  static const int kStringResourceOffset = 3 * kApiPointerSize;
6944
7151
 
6945
- static const int kOddballKindOffset = 3 * kApiPointerSize;
7152
+ static const int kOddballKindOffset = 4 * kApiPointerSize;
6946
7153
  static const int kForeignAddressOffset = kApiPointerSize;
6947
7154
  static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
6948
7155
  static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
6949
7156
  static const int kContextHeaderSize = 2 * kApiPointerSize;
6950
- static const int kContextEmbedderDataIndex = 81;
7157
+ static const int kContextEmbedderDataIndex = 5;
6951
7158
  static const int kFullStringRepresentationMask = 0x07;
6952
7159
  static const int kStringEncodingMask = 0x4;
6953
7160
  static const int kExternalTwoByteRepresentationTag = 0x02;
@@ -6979,8 +7186,9 @@ class Internals {
6979
7186
  static const int kNodeStateIsNearDeathValue = 4;
6980
7187
  static const int kNodeIsIndependentShift = 3;
6981
7188
  static const int kNodeIsPartiallyDependentShift = 4;
7189
+ static const int kNodeIsActiveShift = 4;
6982
7190
 
6983
- static const int kJSObjectType = 0xbe;
7191
+ static const int kJSObjectType = 0xb5;
6984
7192
  static const int kFirstNonstringType = 0x80;
6985
7193
  static const int kOddballType = 0x83;
6986
7194
  static const int kForeignType = 0x87;
@@ -7058,7 +7266,7 @@ class Internals {
7058
7266
  V8_INLINE static void SetEmbedderData(v8::Isolate* isolate,
7059
7267
  uint32_t slot,
7060
7268
  void* data) {
7061
- uint8_t *addr = reinterpret_cast<uint8_t *>(isolate) +
7269
+ uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) +
7062
7270
  kIsolateEmbedderDataOffset + slot * kApiPointerSize;
7063
7271
  *reinterpret_cast<void**>(addr) = data;
7064
7272
  }
@@ -7214,7 +7422,7 @@ void PersistentBase<T>::Reset() {
7214
7422
 
7215
7423
  template <class T>
7216
7424
  template <class S>
7217
- void PersistentBase<T>::Reset(Isolate* isolate, const Handle<S>& other) {
7425
+ void PersistentBase<T>::Reset(Isolate* isolate, const Local<S>& other) {
7218
7426
  TYPE_CHECK(T, S);
7219
7427
  Reset();
7220
7428
  if (other.IsEmpty()) return;
@@ -7305,6 +7513,15 @@ void PersistentBase<T>::MarkPartiallyDependent() {
7305
7513
  }
7306
7514
 
7307
7515
 
7516
+ template <class T>
7517
+ void PersistentBase<T>::MarkActive() {
7518
+ typedef internal::Internals I;
7519
+ if (this->IsEmpty()) return;
7520
+ I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), true,
7521
+ I::kNodeIsActiveShift);
7522
+ }
7523
+
7524
+
7308
7525
  template <class T>
7309
7526
  void PersistentBase<T>::SetWrapperClassId(uint16_t class_id) {
7310
7527
  typedef internal::Internals I;
@@ -7511,14 +7728,14 @@ int FunctionCallbackInfo<T>::Length() const {
7511
7728
  return length_;
7512
7729
  }
7513
7730
 
7514
- ScriptOrigin::ScriptOrigin(Handle<Value> resource_name,
7515
- Handle<Integer> resource_line_offset,
7516
- Handle<Integer> resource_column_offset,
7517
- Handle<Boolean> resource_is_shared_cross_origin,
7518
- Handle<Integer> script_id,
7519
- Handle<Boolean> resource_is_embedder_debug_script,
7520
- Handle<Value> source_map_url,
7521
- Handle<Boolean> resource_is_opaque)
7731
+ ScriptOrigin::ScriptOrigin(Local<Value> resource_name,
7732
+ Local<Integer> resource_line_offset,
7733
+ Local<Integer> resource_column_offset,
7734
+ Local<Boolean> resource_is_shared_cross_origin,
7735
+ Local<Integer> script_id,
7736
+ Local<Boolean> resource_is_embedder_debug_script,
7737
+ Local<Value> source_map_url,
7738
+ Local<Boolean> resource_is_opaque)
7522
7739
  : resource_name_(resource_name),
7523
7740
  resource_line_offset_(resource_line_offset),
7524
7741
  resource_column_offset_(resource_column_offset),
@@ -7530,27 +7747,23 @@ ScriptOrigin::ScriptOrigin(Handle<Value> resource_name,
7530
7747
  script_id_(script_id),
7531
7748
  source_map_url_(source_map_url) {}
7532
7749
 
7533
- Handle<Value> ScriptOrigin::ResourceName() const {
7534
- return resource_name_;
7535
- }
7750
+ Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
7536
7751
 
7537
7752
 
7538
- Handle<Integer> ScriptOrigin::ResourceLineOffset() const {
7753
+ Local<Integer> ScriptOrigin::ResourceLineOffset() const {
7539
7754
  return resource_line_offset_;
7540
7755
  }
7541
7756
 
7542
7757
 
7543
- Handle<Integer> ScriptOrigin::ResourceColumnOffset() const {
7758
+ Local<Integer> ScriptOrigin::ResourceColumnOffset() const {
7544
7759
  return resource_column_offset_;
7545
7760
  }
7546
7761
 
7547
7762
 
7548
- Handle<Integer> ScriptOrigin::ScriptID() const {
7549
- return script_id_;
7550
- }
7763
+ Local<Integer> ScriptOrigin::ScriptID() const { return script_id_; }
7551
7764
 
7552
7765
 
7553
- Handle<Value> ScriptOrigin::SourceMapUrl() const { return source_map_url_; }
7766
+ Local<Value> ScriptOrigin::SourceMapUrl() const { return source_map_url_; }
7554
7767
 
7555
7768
 
7556
7769
  ScriptCompiler::Source::Source(Local<String> string, const ScriptOrigin& origin,
@@ -7580,12 +7793,12 @@ const ScriptCompiler::CachedData* ScriptCompiler::Source::GetCachedData()
7580
7793
  }
7581
7794
 
7582
7795
 
7583
- Handle<Boolean> Boolean::New(Isolate* isolate, bool value) {
7796
+ Local<Boolean> Boolean::New(Isolate* isolate, bool value) {
7584
7797
  return value ? True(isolate) : False(isolate);
7585
7798
  }
7586
7799
 
7587
7800
 
7588
- void Template::Set(Isolate* isolate, const char* name, v8::Handle<Data> value) {
7801
+ void Template::Set(Isolate* isolate, const char* name, v8::Local<Data> value) {
7589
7802
  Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
7590
7803
  .ToLocalChecked(),
7591
7804
  value);
@@ -7932,6 +8145,14 @@ Promise* Promise::Cast(v8::Value* value) {
7932
8145
  }
7933
8146
 
7934
8147
 
8148
+ Proxy* Proxy::Cast(v8::Value* value) {
8149
+ #ifdef V8_ENABLE_CHECKS
8150
+ CheckCast(value);
8151
+ #endif
8152
+ return static_cast<Proxy*>(value);
8153
+ }
8154
+
8155
+
7935
8156
  Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) {
7936
8157
  #ifdef V8_ENABLE_CHECKS
7937
8158
  CheckCast(value);
@@ -8097,40 +8318,46 @@ ReturnValue<T> PropertyCallbackInfo<T>::GetReturnValue() const {
8097
8318
  return ReturnValue<T>(&args_[kReturnValueIndex]);
8098
8319
  }
8099
8320
 
8321
+ template <typename T>
8322
+ bool PropertyCallbackInfo<T>::ShouldThrowOnError() const {
8323
+ typedef internal::Internals I;
8324
+ return args_[kShouldThrowOnErrorIndex] != I::IntToSmi(0);
8325
+ }
8326
+
8100
8327
 
8101
- Handle<Primitive> Undefined(Isolate* isolate) {
8328
+ Local<Primitive> Undefined(Isolate* isolate) {
8102
8329
  typedef internal::Object* S;
8103
8330
  typedef internal::Internals I;
8104
8331
  I::CheckInitialized(isolate);
8105
8332
  S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
8106
- return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
8333
+ return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
8107
8334
  }
8108
8335
 
8109
8336
 
8110
- Handle<Primitive> Null(Isolate* isolate) {
8337
+ Local<Primitive> Null(Isolate* isolate) {
8111
8338
  typedef internal::Object* S;
8112
8339
  typedef internal::Internals I;
8113
8340
  I::CheckInitialized(isolate);
8114
8341
  S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
8115
- return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
8342
+ return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
8116
8343
  }
8117
8344
 
8118
8345
 
8119
- Handle<Boolean> True(Isolate* isolate) {
8346
+ Local<Boolean> True(Isolate* isolate) {
8120
8347
  typedef internal::Object* S;
8121
8348
  typedef internal::Internals I;
8122
8349
  I::CheckInitialized(isolate);
8123
8350
  S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
8124
- return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
8351
+ return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
8125
8352
  }
8126
8353
 
8127
8354
 
8128
- Handle<Boolean> False(Isolate* isolate) {
8355
+ Local<Boolean> False(Isolate* isolate) {
8129
8356
  typedef internal::Object* S;
8130
8357
  typedef internal::Internals I;
8131
8358
  I::CheckInitialized(isolate);
8132
8359
  S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
8133
- return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
8360
+ return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
8134
8361
  }
8135
8362
 
8136
8363
 
@@ -8166,7 +8393,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
8166
8393
  if (change_in_bytes > 0 &&
8167
8394
  amount - *amount_of_external_allocated_memory_at_last_global_gc >
8168
8395
  I::kExternalAllocationLimit) {
8169
- CollectAllGarbage("external memory allocation limit reached.");
8396
+ ReportExternalAllocationLimitReached();
8170
8397
  }
8171
8398
  *amount_of_external_allocated_memory = amount;
8172
8399
  return *amount_of_external_allocated_memory;
@@ -8238,7 +8465,7 @@ bool V8::IsDead() {
8238
8465
  }
8239
8466
 
8240
8467
 
8241
- bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) {
8468
+ bool V8::AddMessageListener(MessageCallback that, Local<Value> data) {
8242
8469
  Isolate* isolate = Isolate::GetCurrent();
8243
8470
  return isolate->AddMessageListener(that, data);
8244
8471
  }
@@ -8271,17 +8498,17 @@ void V8::SetFatalErrorHandler(FatalErrorCallback callback) {
8271
8498
  }
8272
8499
 
8273
8500
 
8274
- void V8::RemoveGCPrologueCallback(GCPrologueCallback callback) {
8501
+ void V8::RemoveGCPrologueCallback(GCCallback callback) {
8275
8502
  Isolate* isolate = Isolate::GetCurrent();
8276
8503
  isolate->RemoveGCPrologueCallback(
8277
- reinterpret_cast<v8::Isolate::GCPrologueCallback>(callback));
8504
+ reinterpret_cast<v8::Isolate::GCCallback>(callback));
8278
8505
  }
8279
8506
 
8280
8507
 
8281
- void V8::RemoveGCEpilogueCallback(GCEpilogueCallback callback) {
8508
+ void V8::RemoveGCEpilogueCallback(GCCallback callback) {
8282
8509
  Isolate* isolate = Isolate::GetCurrent();
8283
8510
  isolate->RemoveGCEpilogueCallback(
8284
- reinterpret_cast<v8::Isolate::GCEpilogueCallback>(callback));
8511
+ reinterpret_cast<v8::Isolate::GCCallback>(callback));
8285
8512
  }
8286
8513
 
8287
8514
 
@@ -8356,4 +8583,4 @@ void V8::VisitHandlesForPartialDependence(Isolate* isolate,
8356
8583
  #undef TYPE_CHECK
8357
8584
 
8358
8585
 
8359
- #endif // V8_H_
8586
+ #endif // INCLUDE_V8_H_