Commit b9bf2051 authored by dcarney's avatar dcarney Committed by Commit bot

convert more things to maybe

BUG=v8:3929
LOG=y

Review URL: https://codereview.chromium.org/982123003

Cr-Commit-Position: refs/heads/master@{#27038}
parent b2ae7a75
...@@ -1085,7 +1085,9 @@ class V8_EXPORT Script { ...@@ -1085,7 +1085,9 @@ class V8_EXPORT Script {
* context in which it was created (ScriptCompiler::CompileBound or * context in which it was created (ScriptCompiler::CompileBound or
* UnboundScript::BindToCurrentContext()). * UnboundScript::BindToCurrentContext()).
*/ */
// TODO(dcarney): deprecate
Local<Value> Run(); Local<Value> Run();
MaybeLocal<Value> Run(Local<Context> context);
/** /**
* Returns the corresponding context-unbound script. * Returns the corresponding context-unbound script.
...@@ -1398,7 +1400,10 @@ class V8_EXPORT ScriptCompiler { ...@@ -1398,7 +1400,10 @@ class V8_EXPORT ScriptCompiler {
class V8_EXPORT Message { class V8_EXPORT Message {
public: public:
Local<String> Get() const; Local<String> Get() const;
// TODO(dcarney): deprecate
Local<String> GetSourceLine() const; Local<String> GetSourceLine() const;
MaybeLocal<String> GetSourceLine(Local<Context> context) const;
/** /**
* Returns the origin for the script from where the function causing the * Returns the origin for the script from where the function causing the
...@@ -1422,7 +1427,9 @@ class V8_EXPORT Message { ...@@ -1422,7 +1427,9 @@ class V8_EXPORT Message {
/** /**
* Returns the number, 1-based, of the line where the error occurred. * Returns the number, 1-based, of the line where the error occurred.
*/ */
// TODO(dcarney): deprecate
int GetLineNumber() const; int GetLineNumber() const;
Maybe<int> GetLineNumber(Local<Context> context) const;
/** /**
* Returns the index within the script of the first character where * Returns the index within the script of the first character where
...@@ -1440,13 +1447,17 @@ class V8_EXPORT Message { ...@@ -1440,13 +1447,17 @@ class V8_EXPORT Message {
* Returns the index within the line of the first character where * Returns the index within the line of the first character where
* the error occurred. * the error occurred.
*/ */
// TODO(dcarney): deprecate
int GetStartColumn() const; int GetStartColumn() const;
Maybe<int> GetStartColumn(Local<Context> context) const;
/** /**
* Returns the index within the line of the last character where * Returns the index within the line of the last character where
* the error occurred. * the error occurred.
*/ */
// TODO(dcarney): deprecate
int GetEndColumn() const; int GetEndColumn() const;
Maybe<int> GetEndColumn(Local<Context> context) const;
/** /**
* Passes on the value set by the embedder when it fed the script from which * Passes on the value set by the embedder when it fed the script from which
...@@ -1613,7 +1624,9 @@ class V8_EXPORT JSON { ...@@ -1613,7 +1624,9 @@ class V8_EXPORT JSON {
* \param json_string The string to parse. * \param json_string The string to parse.
* \return The corresponding value if successfully parsed. * \return The corresponding value if successfully parsed.
*/ */
// TODO(dcarney): deprecate
static Local<Value> Parse(Local<String> json_string); static Local<Value> Parse(Local<String> json_string);
static MaybeLocal<Value> Parse(Isolate* isolate, Local<String> json_string);
}; };
...@@ -1926,7 +1939,9 @@ class V8_EXPORT Value : public Data { ...@@ -1926,7 +1939,9 @@ class V8_EXPORT Value : public Data {
* Attempts to convert a string to an array index. * Attempts to convert a string to an array index.
* Returns an empty handle if the conversion fails. * Returns an empty handle if the conversion fails.
*/ */
// TODO(dcarney): deprecate.
Local<Uint32> ToArrayIndex() const; Local<Uint32> ToArrayIndex() const;
MaybeLocal<Uint32> ToArrayIndex(Local<Context> context) const;
Maybe<bool> BooleanValue(Local<Context> context) const; Maybe<bool> BooleanValue(Local<Context> context) const;
Maybe<double> NumberValue(Local<Context> context) const; Maybe<double> NumberValue(Local<Context> context) const;
...@@ -1942,7 +1957,9 @@ class V8_EXPORT Value : public Data { ...@@ -1942,7 +1957,9 @@ class V8_EXPORT Value : public Data {
int32_t Int32Value() const; int32_t Int32Value() const;
/** JS == */ /** JS == */
// TODO(dcarney): deprecate.
bool Equals(Handle<Value> that) const; bool Equals(Handle<Value> that) const;
Maybe<bool> Equals(Local<Context> context, Handle<Value> that) const;
bool StrictEquals(Handle<Value> that) const; bool StrictEquals(Handle<Value> that) const;
bool SameValue(Handle<Value> that) const; bool SameValue(Handle<Value> that) const;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment