[api] remove old deprecated APIs.
These APIs have been marked as deprecated for more than 6 months. Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I4f05a8904c367f335be7e159709f564362c8bbd9 Reviewed-on: https://chromium-review.googlesource.com/848782 Reviewed-by: Adam Klein <adamk@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#50368}
This commit is contained in:
parent
54c4cc5f82
commit
b822d3e17f
339
include/v8.h
339
include/v8.h
@ -1191,9 +1191,6 @@ class V8_EXPORT Module {
|
||||
* instantiation. (In the case where the callback throws an exception, that
|
||||
* exception is propagated.)
|
||||
*/
|
||||
V8_DEPRECATED("Use Maybe<bool> version",
|
||||
bool Instantiate(Local<Context> context,
|
||||
ResolveCallback callback));
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule(Local<Context> context,
|
||||
ResolveCallback callback);
|
||||
|
||||
@ -1461,11 +1458,6 @@ class V8_EXPORT ScriptCompiler {
|
||||
* \return Compiled script object (context independent; for running it must be
|
||||
* bound to a context).
|
||||
*/
|
||||
static V8_DEPRECATED("Use maybe version",
|
||||
Local<UnboundScript> CompileUnbound(
|
||||
Isolate* isolate, Source* source,
|
||||
CompileOptions options = kNoCompileOptions,
|
||||
NoCacheReason no_cache_reason = kNoCacheNoReason));
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<UnboundScript> CompileUnboundScript(
|
||||
Isolate* isolate, Source* source,
|
||||
CompileOptions options = kNoCompileOptions,
|
||||
@ -1482,11 +1474,6 @@ class V8_EXPORT ScriptCompiler {
|
||||
* when this function was called. When run it will always use this
|
||||
* context.
|
||||
*/
|
||||
static V8_DEPRECATED(
|
||||
"Use maybe version",
|
||||
Local<Script> Compile(Isolate* isolate, Source* source,
|
||||
CompileOptions options = kNoCompileOptions,
|
||||
NoCacheReason no_cache_reason = kNoCacheNoReason));
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
|
||||
Local<Context> context, Source* source,
|
||||
CompileOptions options = kNoCompileOptions,
|
||||
@ -1514,11 +1501,6 @@ class V8_EXPORT ScriptCompiler {
|
||||
* (ScriptStreamingTask has been run). V8 doesn't construct the source string
|
||||
* during streaming, so the embedder needs to pass the full source here.
|
||||
*/
|
||||
static V8_DEPRECATED("Use maybe version",
|
||||
Local<Script> Compile(Isolate* isolate,
|
||||
StreamedSource* source,
|
||||
Local<String> full_source_string,
|
||||
const ScriptOrigin& origin));
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
|
||||
Local<Context> context, StreamedSource* source,
|
||||
Local<String> full_source_string, const ScriptOrigin& origin);
|
||||
@ -1654,7 +1636,6 @@ class V8_EXPORT Message {
|
||||
* Returns the index within the line of the last character where
|
||||
* the error occurred.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version", int GetEndColumn() const);
|
||||
V8_WARN_UNUSED_RESULT Maybe<int> GetEndColumn(Local<Context> context) const;
|
||||
|
||||
/**
|
||||
@ -1710,11 +1691,6 @@ class V8_EXPORT StackTrace {
|
||||
*/
|
||||
int GetFrameCount() const;
|
||||
|
||||
/**
|
||||
* Returns StackTrace as a v8::Array that contains StackFrame objects.
|
||||
*/
|
||||
V8_DEPRECATED("Use native API instead", Local<Array> AsArray());
|
||||
|
||||
/**
|
||||
* Grab a snapshot of the current JavaScript execution stack.
|
||||
*
|
||||
@ -1836,8 +1812,6 @@ class V8_EXPORT JSON {
|
||||
* \param json_string The string to parse.
|
||||
* \return The corresponding value if successfully parsed.
|
||||
*/
|
||||
static V8_DEPRECATED("Use the maybe version taking context",
|
||||
Local<Value> Parse(Local<String> json_string));
|
||||
static V8_DEPRECATE_SOON("Use the maybe version taking context",
|
||||
MaybeLocal<Value> Parse(Isolate* isolate,
|
||||
Local<String> json_string));
|
||||
@ -2373,34 +2347,24 @@ class V8_EXPORT Value : public Data {
|
||||
Local<Number> ToNumber(Isolate* isolate) const);
|
||||
V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<String> ToString(Isolate* isolate) const);
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<String> ToDetailString(Isolate* isolate) const);
|
||||
V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Object> ToObject(Isolate* isolate) const);
|
||||
V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Integer> ToInteger(Isolate* isolate) const);
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Uint32> ToUint32(Isolate* isolate) const);
|
||||
V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Int32> ToInt32(Isolate* isolate) const);
|
||||
|
||||
inline V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Boolean> ToBoolean() const);
|
||||
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
|
||||
inline V8_DEPRECATE_SOON("Use maybe version", Local<String> ToString() const);
|
||||
inline V8_DEPRECATED("Use maybe version",
|
||||
Local<String> ToDetailString() const);
|
||||
inline V8_DEPRECATE_SOON("Use maybe version", Local<Object> ToObject() const);
|
||||
inline V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Integer> ToInteger() const);
|
||||
inline V8_DEPRECATED("Use maybe version", Local<Uint32> ToUint32() const);
|
||||
inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
|
||||
|
||||
/**
|
||||
* Attempts to convert a string to an array index.
|
||||
* Returns an empty handle if the conversion fails.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version", Local<Uint32> ToArrayIndex() const);
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToArrayIndex(
|
||||
Local<Context> context) const;
|
||||
|
||||
@ -2731,13 +2695,6 @@ class V8_EXPORT String : public Name {
|
||||
Isolate* isolate, const char* data, v8::NewStringType type,
|
||||
int length = -1);
|
||||
|
||||
/** Allocates a new string from Latin-1 data.*/
|
||||
static V8_DEPRECATED(
|
||||
"Use maybe version",
|
||||
Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
|
||||
NewStringType type = kNormalString,
|
||||
int length = -1));
|
||||
|
||||
/** Allocates a new string from Latin-1 data. Only returns an empty value
|
||||
* when length > kMaxLength. **/
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte(
|
||||
@ -2771,9 +2728,6 @@ class V8_EXPORT String : public Name {
|
||||
* should the underlying buffer be deallocated or modified except through the
|
||||
* destructor of the external string resource.
|
||||
*/
|
||||
static V8_DEPRECATED("Use maybe version",
|
||||
Local<String> NewExternal(
|
||||
Isolate* isolate, ExternalStringResource* resource));
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalTwoByte(
|
||||
Isolate* isolate, ExternalStringResource* resource);
|
||||
|
||||
@ -3159,19 +3113,6 @@ class V8_EXPORT Object : public Value {
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty(
|
||||
Local<Context> context, Local<Name> key, PropertyDescriptor& descriptor);
|
||||
|
||||
// Sets an own property on this object bypassing interceptors and
|
||||
// overriding accessors or read-only properties.
|
||||
//
|
||||
// Note that if the object has an interceptor the property will be set
|
||||
// locally, but since the interceptor takes precedence the local property
|
||||
// will only be returned if the interceptor doesn't return a value.
|
||||
//
|
||||
// Note also that this only works for named properties.
|
||||
V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty",
|
||||
Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
|
||||
Local<Value> value,
|
||||
PropertyAttribute attribs = None));
|
||||
|
||||
V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
|
||||
Local<Value> key);
|
||||
@ -3185,16 +3126,12 @@ class V8_EXPORT Object : public Value {
|
||||
* any combination of ReadOnly, DontEnum and DontDelete. Returns
|
||||
* None when the property doesn't exist.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
PropertyAttribute GetPropertyAttributes(Local<Value> key));
|
||||
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetPropertyAttributes(
|
||||
Local<Context> context, Local<Value> key);
|
||||
|
||||
/**
|
||||
* Returns Object.getOwnPropertyDescriptor as per ES2016 section 19.1.2.6.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Value> GetOwnPropertyDescriptor(Local<Name> key));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetOwnPropertyDescriptor(
|
||||
Local<Context> context, Local<Name> key);
|
||||
|
||||
@ -3221,28 +3158,12 @@ class V8_EXPORT Object : public Value {
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
|
||||
Local<Value> key);
|
||||
|
||||
V8_DEPRECATED("Use maybe version", bool Has(uint32_t index));
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
|
||||
uint32_t index);
|
||||
|
||||
V8_DEPRECATED("Use maybe version", bool Delete(uint32_t index));
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
|
||||
uint32_t index);
|
||||
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
bool SetAccessor(Local<String> name,
|
||||
AccessorGetterCallback getter,
|
||||
AccessorSetterCallback setter = 0,
|
||||
Local<Value> data = Local<Value>(),
|
||||
AccessControl settings = DEFAULT,
|
||||
PropertyAttribute attribute = None));
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
bool SetAccessor(Local<Name> name,
|
||||
AccessorNameGetterCallback getter,
|
||||
AccessorNameSetterCallback setter = 0,
|
||||
Local<Value> data = Local<Value>(),
|
||||
AccessControl settings = DEFAULT,
|
||||
PropertyAttribute attribute = None));
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> SetAccessor(Local<Context> context,
|
||||
Local<Name> name,
|
||||
AccessorNameGetterCallback getter,
|
||||
@ -3321,7 +3242,6 @@ class V8_EXPORT Object : public Value {
|
||||
* be skipped by __proto__ and it does not consult the security
|
||||
* handler.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
|
||||
Local<Value> prototype);
|
||||
|
||||
@ -3336,7 +3256,6 @@ class V8_EXPORT Object : public Value {
|
||||
* This is different from Value::ToString() that may call
|
||||
* user-defined toString function. This one does not.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version", Local<String> ObjectProtoToString());
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<String> ObjectProtoToString(
|
||||
Local<Context> context);
|
||||
|
||||
@ -3387,9 +3306,6 @@ class V8_EXPORT Object : public Value {
|
||||
void SetAlignedPointerInInternalFields(int argc, int indices[],
|
||||
void* values[]);
|
||||
|
||||
// Testers for local properties.
|
||||
V8_DEPRECATED("Use maybe version", bool HasOwnProperty(Local<String> key));
|
||||
|
||||
/**
|
||||
* HasOwnProperty() is like JavaScript's Object.prototype.hasOwnProperty().
|
||||
*
|
||||
@ -3429,9 +3345,6 @@ class V8_EXPORT Object : public Value {
|
||||
* If result.IsEmpty() no real property was located in the prototype chain.
|
||||
* This means interceptors in the prototype chain are not called.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use maybe version",
|
||||
Local<Value> GetRealNamedPropertyInPrototypeChain(Local<String> key));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedPropertyInPrototypeChain(
|
||||
Local<Context> context, Local<Name> key);
|
||||
|
||||
@ -3440,10 +3353,6 @@ class V8_EXPORT Object : public Value {
|
||||
* which can be None or any combination of ReadOnly, DontEnum and DontDelete.
|
||||
* Interceptors in the prototype chain are not called.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use maybe version",
|
||||
Maybe<PropertyAttribute> GetRealNamedPropertyAttributesInPrototypeChain(
|
||||
Local<String> key));
|
||||
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute>
|
||||
GetRealNamedPropertyAttributesInPrototypeChain(Local<Context> context,
|
||||
Local<Name> key);
|
||||
@ -3453,8 +3362,6 @@ class V8_EXPORT Object : public Value {
|
||||
* in the prototype chain.
|
||||
* This means interceptors in the prototype chain are not called.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Value> GetRealNamedProperty(Local<String> key));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
|
||||
Local<Context> context, Local<Name> key);
|
||||
|
||||
@ -3463,9 +3370,6 @@ class V8_EXPORT Object : public Value {
|
||||
* None or any combination of ReadOnly, DontEnum and DontDelete.
|
||||
* Interceptors in the prototype chain are not called.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
|
||||
Local<String> key));
|
||||
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
|
||||
Local<Context> context, Local<Name> key);
|
||||
|
||||
@ -3518,9 +3422,6 @@ class V8_EXPORT Object : public Value {
|
||||
* Call an Object as a function if a callback is set by the
|
||||
* ObjectTemplate::SetCallAsFunctionHandler method.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Value> CallAsFunction(Local<Value> recv, int argc,
|
||||
Local<Value> argv[]));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context,
|
||||
Local<Value> recv,
|
||||
int argc,
|
||||
@ -3531,8 +3432,6 @@ class V8_EXPORT Object : public Value {
|
||||
* ObjectTemplate::SetCallAsFunctionHandler method.
|
||||
* Note: This method behaves like the Function::NewInstance method.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Value> CallAsConstructor(int argc, Local<Value> argv[]));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsConstructor(
|
||||
Local<Context> context, int argc, Local<Value> argv[]);
|
||||
|
||||
@ -3560,16 +3459,6 @@ class V8_EXPORT Array : public Object {
|
||||
public:
|
||||
uint32_t Length() const;
|
||||
|
||||
/**
|
||||
* Clones an element at index |index|. Returns an empty
|
||||
* handle if cloning fails (for any reason).
|
||||
*/
|
||||
V8_DEPRECATED("Cloning is not supported.",
|
||||
Local<Object> CloneElementAt(uint32_t index));
|
||||
V8_DEPRECATED("Cloning is not supported.",
|
||||
MaybeLocal<Object> CloneElementAt(Local<Context> context,
|
||||
uint32_t index));
|
||||
|
||||
/**
|
||||
* Creates a JavaScript array with the given length. If the length
|
||||
* is negative the returned array will have length 0.
|
||||
@ -3892,12 +3781,9 @@ class V8_EXPORT Function : public Object {
|
||||
Local<Function> New(Isolate* isolate, FunctionCallback callback,
|
||||
Local<Value> data = Local<Value>(), int length = 0));
|
||||
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Object> NewInstance(int argc, Local<Value> argv[]) const);
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
|
||||
Local<Context> context, int argc, Local<Value> argv[]) const;
|
||||
|
||||
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
|
||||
Local<Context> context) const {
|
||||
return NewInstance(context, 0, nullptr);
|
||||
@ -3944,11 +3830,6 @@ class V8_EXPORT Function : public Object {
|
||||
*/
|
||||
int GetScriptColumnNumber() const;
|
||||
|
||||
/**
|
||||
* Tells whether this function is builtin.
|
||||
*/
|
||||
V8_DEPRECATED("this should no longer be used.", bool IsBuiltin() const);
|
||||
|
||||
/**
|
||||
* Returns scriptId.
|
||||
*/
|
||||
@ -4025,13 +3906,9 @@ class V8_EXPORT Promise : public Object {
|
||||
* an argument. If the promise is already resolved/rejected, the handler is
|
||||
* invoked at the end of turn.
|
||||
*/
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Promise> Catch(Local<Function> handler));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context,
|
||||
Local<Function> handler);
|
||||
|
||||
V8_DEPRECATED("Use maybe version",
|
||||
Local<Promise> Then(Local<Function> handler));
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context,
|
||||
Local<Function> handler);
|
||||
|
||||
@ -4925,7 +4802,6 @@ class V8_EXPORT NumberObject : public Object {
|
||||
class V8_EXPORT BooleanObject : public Object {
|
||||
public:
|
||||
static Local<Value> New(Isolate* isolate, bool value);
|
||||
V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
|
||||
|
||||
bool ValueOf() const;
|
||||
|
||||
@ -5794,7 +5670,6 @@ class V8_EXPORT ObjectTemplate : public Template {
|
||||
static Local<ObjectTemplate> New(
|
||||
Isolate* isolate,
|
||||
Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
|
||||
static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
|
||||
|
||||
/** Get a template included in the snapshot by index. */
|
||||
static MaybeLocal<ObjectTemplate> FromSnapshot(Isolate* isolate,
|
||||
@ -6226,8 +6101,6 @@ class V8_EXPORT Exception {
|
||||
* or capture the current stack trace if not available.
|
||||
*/
|
||||
static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception);
|
||||
V8_DEPRECATED("Use version with an Isolate*",
|
||||
static Local<Message> CreateMessage(Local<Value> exception));
|
||||
|
||||
/**
|
||||
* Returns the original stack trace that was captured at the creation time
|
||||
@ -6349,11 +6222,6 @@ class PromiseRejectMessage {
|
||||
V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
|
||||
V8_INLINE Local<Value> GetValue() const { return value_; }
|
||||
|
||||
V8_DEPRECATED("Use v8::Exception::CreateMessage(GetValue())->GetStackTrace()",
|
||||
V8_INLINE Local<StackTrace> GetStackTrace() const) {
|
||||
return stack_trace_;
|
||||
}
|
||||
|
||||
private:
|
||||
Local<Promise> promise_;
|
||||
PromiseRejectEvent event_;
|
||||
@ -7616,9 +7484,6 @@ class V8_EXPORT Isolate {
|
||||
*/
|
||||
bool IdleNotificationDeadline(double deadline_in_seconds);
|
||||
|
||||
V8_DEPRECATED("use IdleNotificationDeadline()",
|
||||
bool IdleNotification(int idle_time_in_ms));
|
||||
|
||||
/**
|
||||
* Optional notification that the system is running low on memory.
|
||||
* V8 uses these notifications to attempt to free memory.
|
||||
@ -7899,17 +7764,6 @@ typedef uintptr_t (*ReturnAddressLocationResolver)(
|
||||
*/
|
||||
class V8_EXPORT V8 {
|
||||
public:
|
||||
/** Set the callback to invoke in case of fatal errors. */
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
void SetFatalErrorHandler(FatalErrorCallback that));
|
||||
|
||||
/**
|
||||
* Check if V8 is dead and therefore unusable. This is the case after
|
||||
* fatal errors such as out-of-memory situations.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED("Use isolate version", bool IsDead());
|
||||
|
||||
/**
|
||||
* Hand startup data to V8, in case the embedder has chosen to build
|
||||
* V8 with external startup data.
|
||||
@ -7950,35 +7804,6 @@ class V8_EXPORT V8 {
|
||||
/** Set the callback to invoke in case of Dcheck failures. */
|
||||
static void SetDcheckErrorHandler(DcheckErrorCallback that);
|
||||
|
||||
/**
|
||||
* Adds a message listener.
|
||||
*
|
||||
* The same message listener can be added more than once and in that
|
||||
* case it will be called more than once for each message.
|
||||
*
|
||||
* If data is specified, it will be passed to the callback when it is called.
|
||||
* Otherwise, the exception object will be passed to the callback instead.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
bool AddMessageListener(MessageCallback that,
|
||||
Local<Value> data = Local<Value>()));
|
||||
|
||||
/**
|
||||
* Remove all message listeners from the specified callback function.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version", void RemoveMessageListeners(MessageCallback that));
|
||||
|
||||
/**
|
||||
* Tells V8 to capture current stack trace when uncaught exception occurs
|
||||
* and report it to the message listeners. The option is off by default.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
void SetCaptureStackTraceForUncaughtExceptions(
|
||||
bool capture, int frame_limit = 10,
|
||||
StackTrace::StackTraceOptions options = StackTrace::kOverview));
|
||||
|
||||
/**
|
||||
* Sets V8 flags from a string.
|
||||
@ -7995,11 +7820,6 @@ class V8_EXPORT V8 {
|
||||
/** Get the version string. */
|
||||
static const char* GetVersion();
|
||||
|
||||
/** Callback function for reporting failed access checks.*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback));
|
||||
|
||||
/**
|
||||
* Initializes V8. This function needs to be called before the first Isolate
|
||||
* is created. It always returns true.
|
||||
@ -8019,51 +7839,6 @@ class V8_EXPORT V8 {
|
||||
static void SetReturnAddressLocationResolver(
|
||||
ReturnAddressLocationResolver return_address_resolver);
|
||||
|
||||
/**
|
||||
* Forcefully terminate the current thread of JavaScript execution
|
||||
* in the given isolate.
|
||||
*
|
||||
* This method can be used by any thread even if that thread has not
|
||||
* acquired the V8 lock with a Locker object.
|
||||
*
|
||||
* \param isolate The isolate in which to terminate the current JS execution.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED("Use isolate version",
|
||||
void TerminateExecution(Isolate* isolate));
|
||||
|
||||
/**
|
||||
* Is V8 terminating JavaScript execution.
|
||||
*
|
||||
* Returns true if JavaScript execution is currently terminating
|
||||
* because of a call to TerminateExecution. In that case there are
|
||||
* still JavaScript frames on the stack and the termination
|
||||
* exception is still active.
|
||||
*
|
||||
* \param isolate The isolate in which to check.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
bool IsExecutionTerminating(Isolate* isolate = NULL));
|
||||
|
||||
/**
|
||||
* Resume execution capability in the given isolate, whose execution
|
||||
* was previously forcefully terminated using TerminateExecution().
|
||||
*
|
||||
* When execution is forcefully terminated using TerminateExecution(),
|
||||
* the isolate can not resume execution until all JavaScript frames
|
||||
* have propagated the uncatchable exception which is generated. This
|
||||
* method allows the program embedding the engine to handle the
|
||||
* termination event and resume execution capability, even if
|
||||
* JavaScript frames remain on the stack.
|
||||
*
|
||||
* This method can be used by any thread even if that thread has not
|
||||
* acquired the V8 lock with a Locker object.
|
||||
*
|
||||
* \param isolate The isolate in which to resume execution capability.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version", void CancelTerminateExecution(Isolate* isolate));
|
||||
|
||||
/**
|
||||
* Releases any resources used by v8 and stops any utility threads
|
||||
* that may be running. Note that disposing v8 is permanent, it
|
||||
@ -8075,26 +7850,6 @@ class V8_EXPORT V8 {
|
||||
*/
|
||||
static bool Dispose();
|
||||
|
||||
/**
|
||||
* Iterates through all external resources referenced from current isolate
|
||||
* heap. GC is not invoked prior to iterating, therefore there is no
|
||||
* guarantee that visited objects are still alive.
|
||||
*/
|
||||
V8_INLINE static V8_DEPRECATED(
|
||||
"Use isolate version",
|
||||
void VisitExternalResources(ExternalResourceVisitor* visitor));
|
||||
|
||||
/**
|
||||
* Initialize the ICU library bundled with V8. The embedder should only
|
||||
* invoke this method when using the bundled ICU. Returns true on success.
|
||||
*
|
||||
* If V8 was compiled with the ICU data in an external file, the location
|
||||
* of the data file has to be provided.
|
||||
*/
|
||||
V8_DEPRECATE_SOON(
|
||||
"Use version with default location.",
|
||||
static bool InitializeICU(const char* icu_data_file = nullptr));
|
||||
|
||||
/**
|
||||
* Initialize the ICU library bundled with V8. The embedder should only
|
||||
* invoke this method when using the bundled ICU. If V8 was compiled with
|
||||
@ -8398,13 +8153,6 @@ inline Maybe<void> JustVoid() { return Maybe<void>(Maybe<void>::JustTag()); }
|
||||
*/
|
||||
class V8_EXPORT TryCatch {
|
||||
public:
|
||||
/**
|
||||
* Creates a new try/catch block and registers it with v8. Note that
|
||||
* all TryCatch blocks should be stack allocated because the memory
|
||||
* location itself is compared against JavaScript try/catch blocks.
|
||||
*/
|
||||
V8_DEPRECATED("Use isolate version", TryCatch());
|
||||
|
||||
/**
|
||||
* Creates a new try/catch block and registers it with v8. Note that
|
||||
* all TryCatch blocks should be stack allocated because the memory
|
||||
@ -8775,11 +8523,6 @@ class V8_EXPORT Context {
|
||||
*/
|
||||
void SetErrorMessageForCodeGenerationFromStrings(Local<String> message);
|
||||
|
||||
/**
|
||||
* Estimate the memory in bytes retained by this context.
|
||||
*/
|
||||
V8_DEPRECATED("no longer supported", size_t EstimatedSize());
|
||||
|
||||
/**
|
||||
* Stack-allocated class which sets the execution context for all
|
||||
* operations executed within a local scope.
|
||||
@ -9839,24 +9582,12 @@ Local<Boolean> Value::ToBoolean() const {
|
||||
}
|
||||
|
||||
|
||||
Local<Number> Value::ToNumber() const {
|
||||
return ToNumber(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<Number>());
|
||||
}
|
||||
|
||||
|
||||
Local<String> Value::ToString() const {
|
||||
return ToString(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<String>());
|
||||
}
|
||||
|
||||
|
||||
Local<String> Value::ToDetailString() const {
|
||||
return ToDetailString(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<String>());
|
||||
}
|
||||
|
||||
|
||||
Local<Object> Value::ToObject() const {
|
||||
return ToObject(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<Object>());
|
||||
@ -9869,18 +9600,6 @@ Local<Integer> Value::ToInteger() const {
|
||||
}
|
||||
|
||||
|
||||
Local<Uint32> Value::ToUint32() const {
|
||||
return ToUint32(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<Uint32>());
|
||||
}
|
||||
|
||||
|
||||
Local<Int32> Value::ToInt32() const {
|
||||
return ToInt32(Isolate::GetCurrent()->GetCurrentContext())
|
||||
.FromMaybe(Local<Int32>());
|
||||
}
|
||||
|
||||
|
||||
Boolean* Boolean::Cast(v8::Value* value) {
|
||||
#ifdef V8_ENABLE_CHECKS
|
||||
CheckCast(value);
|
||||
@ -10323,64 +10042,6 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool V8::IsDead() {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
return isolate->IsDead();
|
||||
}
|
||||
|
||||
|
||||
bool V8::AddMessageListener(MessageCallback that, Local<Value> data) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
return isolate->AddMessageListener(that, data);
|
||||
}
|
||||
|
||||
|
||||
void V8::RemoveMessageListeners(MessageCallback that) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
isolate->RemoveMessageListeners(that);
|
||||
}
|
||||
|
||||
|
||||
void V8::SetFailedAccessCheckCallbackFunction(
|
||||
FailedAccessCheckCallback callback) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
isolate->SetFailedAccessCheckCallbackFunction(callback);
|
||||
}
|
||||
|
||||
|
||||
void V8::SetCaptureStackTraceForUncaughtExceptions(
|
||||
bool capture, int frame_limit, StackTrace::StackTraceOptions options) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
isolate->SetCaptureStackTraceForUncaughtExceptions(capture, frame_limit,
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
void V8::SetFatalErrorHandler(FatalErrorCallback callback) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
isolate->SetFatalErrorHandler(callback);
|
||||
}
|
||||
|
||||
void V8::TerminateExecution(Isolate* isolate) { isolate->TerminateExecution(); }
|
||||
|
||||
|
||||
bool V8::IsExecutionTerminating(Isolate* isolate) {
|
||||
if (isolate == NULL) {
|
||||
isolate = Isolate::GetCurrent();
|
||||
}
|
||||
return isolate->IsExecutionTerminating();
|
||||
}
|
||||
|
||||
|
||||
void V8::CancelTerminateExecution(Isolate* isolate) {
|
||||
isolate->CancelTerminateExecution();
|
||||
}
|
||||
|
||||
|
||||
void V8::VisitExternalResources(ExternalResourceVisitor* visitor) {
|
||||
Isolate* isolate = Isolate::GetCurrent();
|
||||
isolate->VisitExternalResources(visitor);
|
||||
}
|
||||
|
||||
/**
|
||||
* \example shell.cc
|
||||
|
385
src/api.cc
385
src/api.cc
@ -1603,10 +1603,6 @@ Local<ObjectTemplate> ObjectTemplate::New(
|
||||
}
|
||||
|
||||
|
||||
Local<ObjectTemplate> ObjectTemplate::New() {
|
||||
return New(i::Isolate::Current(), Local<FunctionTemplate>());
|
||||
}
|
||||
|
||||
static Local<ObjectTemplate> ObjectTemplateNew(
|
||||
i::Isolate* isolate, v8::Local<FunctionTemplate> constructor,
|
||||
bool do_not_cache) {
|
||||
@ -2277,11 +2273,6 @@ Local<Value> Module::GetModuleNamespace() {
|
||||
|
||||
int Module::GetIdentityHash() const { return Utils::OpenHandle(this)->hash(); }
|
||||
|
||||
bool Module::Instantiate(Local<Context> context,
|
||||
Module::ResolveCallback callback) {
|
||||
return InstantiateModule(context, callback).FromMaybe(false);
|
||||
}
|
||||
|
||||
Maybe<bool> Module::InstantiateModule(Local<Context> context,
|
||||
Module::ResolveCallback callback) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -2399,18 +2390,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundScript(
|
||||
return CompileUnboundInternal(v8_isolate, source, options, no_cache_reason);
|
||||
}
|
||||
|
||||
Local<UnboundScript> ScriptCompiler::CompileUnbound(
|
||||
Isolate* v8_isolate, Source* source, CompileOptions options,
|
||||
NoCacheReason no_cache_reason) {
|
||||
Utils::ApiCheck(
|
||||
!source->GetResourceOptions().IsModule(),
|
||||
"v8::ScriptCompiler::CompileUnbound",
|
||||
"v8::ScriptCompiler::CompileModule must be used to compile modules");
|
||||
RETURN_TO_LOCAL_UNCHECKED(
|
||||
CompileUnboundInternal(v8_isolate, source, options, no_cache_reason),
|
||||
UnboundScript);
|
||||
}
|
||||
|
||||
MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
||||
Source* source,
|
||||
CompileOptions options,
|
||||
@ -2427,13 +2406,6 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
||||
return result->BindToCurrentContext();
|
||||
}
|
||||
|
||||
Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate, Source* source,
|
||||
CompileOptions options,
|
||||
NoCacheReason no_cache_reason) {
|
||||
auto context = v8_isolate->GetCurrentContext();
|
||||
RETURN_TO_LOCAL_UNCHECKED(Compile(context, source, options), Script);
|
||||
}
|
||||
|
||||
MaybeLocal<Module> ScriptCompiler::CompileModule(Isolate* isolate,
|
||||
Source* source) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
@ -2640,17 +2612,6 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
||||
RETURN_ESCAPED(bound);
|
||||
}
|
||||
|
||||
|
||||
Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
|
||||
StreamedSource* v8_source,
|
||||
Local<String> full_source_string,
|
||||
const ScriptOrigin& origin) {
|
||||
auto context = v8_isolate->GetCurrentContext();
|
||||
RETURN_TO_LOCAL_UNCHECKED(
|
||||
Compile(context, v8_source, full_source_string, origin), Script);
|
||||
}
|
||||
|
||||
|
||||
uint32_t ScriptCompiler::CachedDataVersionTag() {
|
||||
return static_cast<uint32_t>(base::hash_combine(
|
||||
internal::Version::Hash(), internal::FlagList::Hash(),
|
||||
@ -2725,24 +2686,6 @@ Local<Script> Script::Compile(v8::Local<String> source,
|
||||
|
||||
// --- E x c e p t i o n s ---
|
||||
|
||||
|
||||
v8::TryCatch::TryCatch()
|
||||
: isolate_(i::Isolate::Current()),
|
||||
next_(isolate_->try_catch_handler()),
|
||||
is_verbose_(false),
|
||||
can_continue_(true),
|
||||
capture_message_(true),
|
||||
rethrow_(false),
|
||||
has_terminated_(false) {
|
||||
ResetInternal();
|
||||
// Special handling for simulators which have a separate JS stack.
|
||||
js_stack_comparable_address_ =
|
||||
reinterpret_cast<void*>(i::SimulatorStack::RegisterCTryCatch(
|
||||
isolate_, i::GetCurrentStackPosition()));
|
||||
isolate_->RegisterTryCatchHandler(this);
|
||||
}
|
||||
|
||||
|
||||
v8::TryCatch::TryCatch(v8::Isolate* isolate)
|
||||
: isolate_(reinterpret_cast<i::Isolate*>(isolate)),
|
||||
next_(isolate_->try_catch_handler()),
|
||||
@ -2997,13 +2940,6 @@ Maybe<int> Message::GetEndColumn(Local<Context> context) const {
|
||||
}
|
||||
|
||||
|
||||
int Message::GetEndColumn() const {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
const int default_value = kNoColumnInfo;
|
||||
return GetEndColumn(context).FromMaybe(default_value);
|
||||
}
|
||||
|
||||
|
||||
bool Message::IsSharedCrossOrigin() const {
|
||||
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
@ -3064,65 +3000,6 @@ int StackTrace::GetFrameCount() const {
|
||||
return Utils::OpenHandle(this)->length();
|
||||
}
|
||||
|
||||
namespace {
|
||||
i::Handle<i::JSObject> NewFrameObject(i::Isolate* isolate,
|
||||
i::Handle<i::StackFrameInfo> frame) {
|
||||
i::Handle<i::JSObject> frame_obj =
|
||||
isolate->factory()->NewJSObject(isolate->object_function());
|
||||
i::JSObject::AddProperty(
|
||||
frame_obj, handle(isolate->heap()->line_string()),
|
||||
handle(i::Smi::FromInt(frame->line_number() + 1), isolate), i::NONE);
|
||||
i::JSObject::AddProperty(
|
||||
frame_obj, handle(isolate->heap()->column_string()),
|
||||
handle(i::Smi::FromInt(frame->column_number() + 1), isolate), i::NONE);
|
||||
i::JSObject::AddProperty(frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("scriptId")),
|
||||
handle(i::Smi::FromInt(frame->script_id()), isolate),
|
||||
i::NONE);
|
||||
i::JSObject::AddProperty(frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("scriptName")),
|
||||
handle(frame->script_name(), isolate), i::NONE);
|
||||
i::JSObject::AddProperty(frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("scriptNameOrSourceURL")),
|
||||
handle(frame->script_name_or_source_url(), isolate),
|
||||
i::NONE);
|
||||
i::JSObject::AddProperty(frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("functionName")),
|
||||
handle(frame->function_name(), isolate), i::NONE);
|
||||
i::JSObject::AddProperty(frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("isEval")),
|
||||
isolate->factory()->ToBoolean(frame->is_eval()),
|
||||
i::NONE);
|
||||
i::JSObject::AddProperty(
|
||||
frame_obj,
|
||||
isolate->factory()->InternalizeOneByteString(
|
||||
STATIC_CHAR_VECTOR("isConstructor")),
|
||||
isolate->factory()->ToBoolean(frame->is_constructor()), i::NONE);
|
||||
return frame_obj;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Local<Array> StackTrace::AsArray() {
|
||||
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
i::Handle<i::FixedArray> self = Utils::OpenHandle(this);
|
||||
int frame_count = self->length();
|
||||
i::Handle<i::FixedArray> frames =
|
||||
isolate->factory()->NewFixedArray(frame_count);
|
||||
for (int i = 0; i < frame_count; ++i) {
|
||||
auto obj = handle(self->get(i), isolate);
|
||||
auto frame = i::Handle<i::StackFrameInfo>::cast(obj);
|
||||
i::Handle<i::JSObject> frame_obj = NewFrameObject(isolate, frame);
|
||||
frames->set(i, *frame_obj);
|
||||
}
|
||||
return Utils::ToLocal(isolate->factory()->NewJSArrayWithElements(
|
||||
frames, i::PACKED_ELEMENTS, frame_count));
|
||||
}
|
||||
|
||||
|
||||
Local<StackTrace> StackTrace::CurrentStackTrace(
|
||||
Isolate* isolate,
|
||||
@ -3227,10 +3104,6 @@ MaybeLocal<Value> JSON::Parse(Local<Context> context,
|
||||
RETURN_ESCAPED(result);
|
||||
}
|
||||
|
||||
Local<Value> JSON::Parse(Local<String> json_string) {
|
||||
RETURN_TO_LOCAL_UNCHECKED(Parse(Local<Context>(), json_string), Value);
|
||||
}
|
||||
|
||||
MaybeLocal<String> JSON::Stringify(Local<Context> context,
|
||||
Local<Value> json_object,
|
||||
Local<String> gap) {
|
||||
@ -3741,12 +3614,6 @@ MaybeLocal<String> Value::ToDetailString(Local<Context> context) const {
|
||||
}
|
||||
|
||||
|
||||
Local<String> Value::ToDetailString(Isolate* isolate) const {
|
||||
RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()),
|
||||
String);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Object> Value::ToObject(Local<Context> context) const {
|
||||
auto obj = Utils::OpenHandle(this);
|
||||
if (obj->IsJSReceiver()) return ToApiHandle<Object>(obj);
|
||||
@ -3840,11 +3707,6 @@ MaybeLocal<Uint32> Value::ToUint32(Local<Context> context) const {
|
||||
}
|
||||
|
||||
|
||||
Local<Uint32> Value::ToUint32(Isolate* isolate) const {
|
||||
RETURN_TO_LOCAL_UNCHECKED(ToUint32(isolate->GetCurrentContext()), Uint32);
|
||||
}
|
||||
|
||||
|
||||
void i::Internals::CheckInitializedImpl(v8::Isolate* external_isolate) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
|
||||
Utils::ApiCheck(isolate != nullptr && !isolate->IsDead(),
|
||||
@ -4214,17 +4076,6 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
||||
}
|
||||
|
||||
|
||||
Local<Uint32> Value::ToArrayIndex() const {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
if (self->IsSmi()) {
|
||||
if (i::Smi::ToInt(*self) >= 0) return Utils::Uint32ToLocal(self);
|
||||
return Local<Uint32>();
|
||||
}
|
||||
auto context = ContextFromHeapObject(self);
|
||||
RETURN_TO_LOCAL_UNCHECKED(ToArrayIndex(context), Uint32);
|
||||
}
|
||||
|
||||
|
||||
Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
auto other = Utils::OpenHandle(*that);
|
||||
@ -4503,39 +4354,6 @@ Maybe<bool> v8::Object::DefineProperty(v8::Local<v8::Context> context,
|
||||
return success;
|
||||
}
|
||||
|
||||
MUST_USE_RESULT
|
||||
static i::MaybeHandle<i::Object> DefineObjectProperty(
|
||||
i::Handle<i::JSObject> js_object, i::Handle<i::Object> key,
|
||||
i::Handle<i::Object> value, i::PropertyAttributes attrs) {
|
||||
i::Isolate* isolate = js_object->GetIsolate();
|
||||
bool success = false;
|
||||
i::LookupIterator it = i::LookupIterator::PropertyOrElement(
|
||||
isolate, js_object, key, &success, i::LookupIterator::OWN);
|
||||
if (!success) return i::MaybeHandle<i::Object>();
|
||||
|
||||
return i::JSObject::DefineOwnPropertyIgnoreAttributes(
|
||||
&it, value, attrs, i::JSObject::FORCE_FIELD);
|
||||
}
|
||||
|
||||
|
||||
Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context> context,
|
||||
v8::Local<Value> key, v8::Local<Value> value,
|
||||
v8::PropertyAttribute attribs) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
ENTER_V8_NO_SCRIPT(isolate, context, Object, ForceSet, Nothing<bool>(),
|
||||
i::HandleScope);
|
||||
auto self = i::Handle<i::JSObject>::cast(Utils::OpenHandle(this));
|
||||
auto key_obj = Utils::OpenHandle(*key);
|
||||
auto value_obj = Utils::OpenHandle(*value);
|
||||
has_pending_exception =
|
||||
DefineObjectProperty(self, key_obj, value_obj,
|
||||
static_cast<i::PropertyAttributes>(attribs))
|
||||
.is_null();
|
||||
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
|
||||
return Just(true);
|
||||
}
|
||||
|
||||
|
||||
Maybe<bool> v8::Object::SetPrivate(Local<Context> context, Local<Private> key,
|
||||
Local<Value> value) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -4629,12 +4447,6 @@ Maybe<PropertyAttribute> v8::Object::GetPropertyAttributes(
|
||||
}
|
||||
|
||||
|
||||
PropertyAttribute v8::Object::GetPropertyAttributes(v8::Local<Value> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return GetPropertyAttributes(context, key)
|
||||
.FromMaybe(static_cast<PropertyAttribute>(i::NONE));
|
||||
}
|
||||
|
||||
MaybeLocal<Value> v8::Object::GetOwnPropertyDescriptor(Local<Context> context,
|
||||
Local<Name> key) {
|
||||
PREPARE_FOR_EXECUTION(context, Object, GetOwnPropertyDescriptor, Value);
|
||||
@ -4652,11 +4464,6 @@ MaybeLocal<Value> v8::Object::GetOwnPropertyDescriptor(Local<Context> context,
|
||||
RETURN_ESCAPED(Utils::ToLocal(desc.ToObject(isolate)));
|
||||
}
|
||||
|
||||
Local<Value> v8::Object::GetOwnPropertyDescriptor(Local<Name> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(GetOwnPropertyDescriptor(context, key), Value);
|
||||
}
|
||||
|
||||
|
||||
Local<Value> v8::Object::GetPrototype() {
|
||||
auto isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
@ -4684,11 +4491,6 @@ Maybe<bool> v8::Object::SetPrototype(Local<Context> context,
|
||||
}
|
||||
|
||||
|
||||
bool v8::Object::SetPrototype(Local<Value> value) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return SetPrototype(context, value).FromMaybe(false);
|
||||
}
|
||||
|
||||
Local<Object> v8::Object::FindInstanceInPrototypeChain(
|
||||
v8::Local<FunctionTemplate> tmpl) {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
@ -4767,12 +4569,6 @@ MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) {
|
||||
}
|
||||
|
||||
|
||||
Local<String> v8::Object::ObjectProtoToString() {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String);
|
||||
}
|
||||
|
||||
|
||||
Local<String> v8::Object::GetConstructorName() {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
i::Handle<i::String> name = i::JSReceiver::GetConstructorName(self);
|
||||
@ -4884,12 +4680,6 @@ Maybe<bool> v8::Object::Delete(Local<Context> context, uint32_t index) {
|
||||
}
|
||||
|
||||
|
||||
bool v8::Object::Delete(uint32_t index) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return Delete(context, index).FromMaybe(false);
|
||||
}
|
||||
|
||||
|
||||
Maybe<bool> v8::Object::Has(Local<Context> context, uint32_t index) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
ENTER_V8(isolate, context, Object, Has, Nothing<bool>(), i::HandleScope);
|
||||
@ -4901,11 +4691,6 @@ Maybe<bool> v8::Object::Has(Local<Context> context, uint32_t index) {
|
||||
}
|
||||
|
||||
|
||||
bool v8::Object::Has(uint32_t index) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return Has(context, index).FromMaybe(false);
|
||||
}
|
||||
|
||||
template <typename Getter, typename Setter, typename Data>
|
||||
static Maybe<bool> ObjectSetAccessor(Local<Context> context, Object* self,
|
||||
Local<Name> name, Getter getter,
|
||||
@ -4952,27 +4737,6 @@ Maybe<bool> Object::SetAccessor(Local<Context> context, Local<Name> name,
|
||||
}
|
||||
|
||||
|
||||
bool Object::SetAccessor(Local<String> name, AccessorGetterCallback getter,
|
||||
AccessorSetterCallback setter, v8::Local<Value> data,
|
||||
AccessControl settings, PropertyAttribute attributes) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return ObjectSetAccessor(context, this, name, getter, setter, data, settings,
|
||||
attributes, i::FLAG_disable_old_api_accessors)
|
||||
.FromMaybe(false);
|
||||
}
|
||||
|
||||
|
||||
bool Object::SetAccessor(Local<Name> name, AccessorNameGetterCallback getter,
|
||||
AccessorNameSetterCallback setter,
|
||||
v8::Local<Value> data, AccessControl settings,
|
||||
PropertyAttribute attributes) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return ObjectSetAccessor(context, this, name, getter, setter, data, settings,
|
||||
attributes, i::FLAG_disable_old_api_accessors)
|
||||
.FromMaybe(false);
|
||||
}
|
||||
|
||||
|
||||
void Object::SetAccessorProperty(Local<Name> name, Local<Function> getter,
|
||||
Local<Function> setter,
|
||||
PropertyAttribute attribute,
|
||||
@ -5026,12 +4790,6 @@ Maybe<bool> v8::Object::HasOwnProperty(Local<Context> context, uint32_t index) {
|
||||
return result;
|
||||
}
|
||||
|
||||
bool v8::Object::HasOwnProperty(Local<String> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return HasOwnProperty(context, key).FromMaybe(false);
|
||||
}
|
||||
|
||||
|
||||
Maybe<bool> v8::Object::HasRealNamedProperty(Local<Context> context,
|
||||
Local<Name> key) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -5133,14 +4891,6 @@ MaybeLocal<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
|
||||
}
|
||||
|
||||
|
||||
Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
|
||||
Local<String> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(GetRealNamedPropertyInPrototypeChain(context, key),
|
||||
Value);
|
||||
}
|
||||
|
||||
|
||||
Maybe<PropertyAttribute>
|
||||
v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(
|
||||
Local<Context> context, Local<Name> key) {
|
||||
@ -5167,13 +4917,6 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(
|
||||
}
|
||||
|
||||
|
||||
Maybe<PropertyAttribute>
|
||||
v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Local<String> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return GetRealNamedPropertyAttributesInPrototypeChain(context, key);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
|
||||
Local<Name> key) {
|
||||
PREPARE_FOR_EXECUTION(context, Object, GetRealNamedProperty, Value);
|
||||
@ -5190,12 +4933,6 @@ MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
|
||||
}
|
||||
|
||||
|
||||
Local<Value> v8::Object::GetRealNamedProperty(Local<String> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(GetRealNamedProperty(context, key), Value);
|
||||
}
|
||||
|
||||
|
||||
Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
|
||||
Local<Context> context, Local<Name> key) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -5217,13 +4954,6 @@ Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
|
||||
}
|
||||
|
||||
|
||||
Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
|
||||
Local<String> key) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
return GetRealNamedPropertyAttributes(context, key);
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Object> v8::Object::Clone() {
|
||||
auto self = i::Handle<i::JSObject>::cast(Utils::OpenHandle(this));
|
||||
auto isolate = self->GetIsolate();
|
||||
@ -5279,15 +5009,6 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Value> Object::CallAsFunction(v8::Local<v8::Value> recv, int argc,
|
||||
v8::Local<v8::Value> argv[]) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv);
|
||||
RETURN_TO_LOCAL_UNCHECKED(CallAsFunction(context, recv, argc, argv_cast),
|
||||
Value);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc,
|
||||
Local<Value> argv[]) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -5306,13 +5027,6 @@ MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc,
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Value> Object::CallAsConstructor(int argc,
|
||||
v8::Local<v8::Value> argv[]) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv);
|
||||
RETURN_TO_LOCAL_UNCHECKED(CallAsConstructor(context, argc, argv_cast), Value);
|
||||
}
|
||||
|
||||
MaybeLocal<Function> Function::New(Local<Context> context,
|
||||
FunctionCallback callback, Local<Value> data,
|
||||
int length, ConstructorBehavior behavior) {
|
||||
@ -5334,12 +5048,6 @@ Local<Function> Function::New(Isolate* v8_isolate, FunctionCallback callback,
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Object> Function::NewInstance() const {
|
||||
return NewInstance(Isolate::GetCurrent()->GetCurrentContext(), 0, nullptr)
|
||||
.FromMaybe(Local<Object>());
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
|
||||
v8::Local<v8::Value> argv[]) const {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -5358,13 +5066,6 @@ MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Object> Function::NewInstance(int argc,
|
||||
v8::Local<v8::Value> argv[]) const {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(NewInstance(context, argc, argv), Object);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<v8::Value> Function::Call(Local<Context> context,
|
||||
v8::Local<v8::Value> recv, int argc,
|
||||
v8::Local<v8::Value> argv[]) {
|
||||
@ -5510,16 +5211,6 @@ int Function::GetScriptColumnNumber() const {
|
||||
}
|
||||
|
||||
|
||||
bool Function::IsBuiltin() const {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
if (!self->IsJSFunction()) {
|
||||
return false;
|
||||
}
|
||||
auto func = i::Handle<i::JSFunction>::cast(self);
|
||||
return !func->shared()->IsUserJavaScript();
|
||||
}
|
||||
|
||||
|
||||
int Function::ScriptId() const {
|
||||
auto self = Utils::OpenHandle(this);
|
||||
if (!self->IsJSFunction()) {
|
||||
@ -6453,10 +6144,6 @@ HeapObjectStatistics::HeapObjectStatistics()
|
||||
HeapCodeStatistics::HeapCodeStatistics()
|
||||
: code_and_metadata_size_(0), bytecode_and_metadata_size_(0) {}
|
||||
|
||||
bool v8::V8::InitializeICU(const char* icu_data_file) {
|
||||
return i::InitializeICU(icu_data_file);
|
||||
}
|
||||
|
||||
bool v8::V8::InitializeICUDefaultLocation(const char* exec_path,
|
||||
const char* icu_data_file) {
|
||||
return i::InitializeICUDefaultLocation(exec_path, icu_data_file);
|
||||
@ -6762,7 +6449,6 @@ void Context::SetErrorMessageForCodeGenerationFromStrings(Local<String> error) {
|
||||
context->set_error_message_for_code_gen_from_strings(*error_handle);
|
||||
}
|
||||
|
||||
size_t Context::EstimatedSize() { return 0; }
|
||||
|
||||
MaybeLocal<v8::Object> ObjectTemplate::NewInstance(Local<Context> context) {
|
||||
PREPARE_FOR_EXECUTION(context, ObjectTemplate, NewInstance, Object);
|
||||
@ -6953,16 +6639,6 @@ MaybeLocal<String> String::NewFromUtf8(Isolate* isolate, const char* data,
|
||||
}
|
||||
|
||||
|
||||
Local<String> String::NewFromOneByte(Isolate* isolate,
|
||||
const uint8_t* data,
|
||||
NewStringType type,
|
||||
int length) {
|
||||
NEW_STRING(isolate, String, NewFromOneByte, uint8_t, data,
|
||||
static_cast<v8::NewStringType>(type), length);
|
||||
RETURN_TO_LOCAL_UNCHECKED(result, String);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<String> String::NewFromOneByte(Isolate* isolate, const uint8_t* data,
|
||||
v8::NewStringType type, int length) {
|
||||
NEW_STRING(isolate, String, NewFromOneByte, uint8_t, data, type, length);
|
||||
@ -7029,12 +6705,6 @@ MaybeLocal<String> v8::String::NewExternalTwoByte(
|
||||
}
|
||||
|
||||
|
||||
Local<String> v8::String::NewExternal(
|
||||
Isolate* isolate, v8::String::ExternalStringResource* resource) {
|
||||
RETURN_TO_LOCAL_UNCHECKED(NewExternalTwoByte(isolate, resource), String);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<String> v8::String::NewExternalOneByte(
|
||||
Isolate* isolate, v8::String::ExternalOneByteStringResource* resource) {
|
||||
CHECK(resource && resource->data());
|
||||
@ -7171,11 +6841,6 @@ Local<v8::Value> v8::BooleanObject::New(Isolate* isolate, bool value) {
|
||||
}
|
||||
|
||||
|
||||
Local<v8::Value> v8::BooleanObject::New(bool value) {
|
||||
return New(Isolate::GetCurrent(), value);
|
||||
}
|
||||
|
||||
|
||||
bool v8::BooleanObject::ValueOf() const {
|
||||
i::Handle<i::Object> obj = Utils::OpenHandle(this);
|
||||
i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj);
|
||||
@ -7344,27 +7009,6 @@ uint32_t v8::Array::Length() const {
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Object> Array::CloneElementAt(Local<Context> context,
|
||||
uint32_t index) {
|
||||
PREPARE_FOR_EXECUTION(context, Array, CloneElementAt, Object);
|
||||
auto self = Utils::OpenHandle(this);
|
||||
if (!self->HasObjectElements()) return Local<Object>();
|
||||
i::FixedArray* elms = i::FixedArray::cast(self->elements());
|
||||
i::Object* paragon = elms->get(index);
|
||||
if (!paragon->IsJSObject()) return Local<Object>();
|
||||
i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
|
||||
Local<Object> result;
|
||||
has_pending_exception =
|
||||
!ToLocal<Object>(isolate->factory()->CopyJSObject(paragon_handle),
|
||||
&result);
|
||||
RETURN_ON_FAILED_EXECUTION(Object);
|
||||
RETURN_ESCAPED(result);
|
||||
}
|
||||
|
||||
|
||||
Local<Object> Array::CloneElementAt(uint32_t index) { return Local<Object>(); }
|
||||
|
||||
|
||||
Local<v8::Map> v8::Map::New(Isolate* isolate) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
LOG_API(i_isolate, Map, New);
|
||||
@ -7681,12 +7325,6 @@ MaybeLocal<Promise> Promise::Catch(Local<Context> context,
|
||||
}
|
||||
|
||||
|
||||
Local<Promise> Promise::Catch(Local<Function> handler) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(Catch(context, handler), Promise);
|
||||
}
|
||||
|
||||
|
||||
MaybeLocal<Promise> Promise::Then(Local<Context> context,
|
||||
Local<Function> handler) {
|
||||
PREPARE_FOR_EXECUTION(context, Promise, Then, Promise);
|
||||
@ -7701,12 +7339,6 @@ MaybeLocal<Promise> Promise::Then(Local<Context> context,
|
||||
}
|
||||
|
||||
|
||||
Local<Promise> Promise::Then(Local<Function> handler) {
|
||||
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
|
||||
RETURN_TO_LOCAL_UNCHECKED(Then(context, handler), Promise);
|
||||
}
|
||||
|
||||
|
||||
bool Promise::HasHandler() {
|
||||
i::Handle<i::JSReceiver> promise = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = promise->GetIsolate();
|
||||
@ -9027,15 +8659,6 @@ void Isolate::SetAddHistogramSampleFunction(
|
||||
}
|
||||
|
||||
|
||||
bool Isolate::IdleNotification(int idle_time_in_ms) {
|
||||
// Returning true tells the caller that it need not
|
||||
// continue to call IdleNotification.
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
|
||||
if (!i::FLAG_use_idle_notification) return true;
|
||||
return isolate->heap()->IdleNotification(idle_time_in_ms);
|
||||
}
|
||||
|
||||
|
||||
bool Isolate::IdleNotificationDeadline(double deadline_in_seconds) {
|
||||
// Returning true tells the caller that it need not
|
||||
// continue to call IdleNotification.
|
||||
@ -9388,14 +9011,6 @@ Local<Message> Exception::CreateMessage(Isolate* isolate,
|
||||
}
|
||||
|
||||
|
||||
Local<Message> Exception::CreateMessage(Local<Value> exception) {
|
||||
i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
|
||||
if (!obj->IsHeapObject()) return Local<Message>();
|
||||
i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate();
|
||||
return CreateMessage(reinterpret_cast<Isolate*>(isolate), exception);
|
||||
}
|
||||
|
||||
|
||||
Local<StackTrace> Exception::GetStackTrace(Local<Value> exception) {
|
||||
i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
|
||||
if (!obj->IsJSObject()) return Local<StackTrace>();
|
||||
|
Loading…
Reference in New Issue
Block a user