Reviewers: Yang,

Message:
PTAL #7

Description:
Handlification TODOs in scanner and string stream resolved.

Please review this at https://codereview.chromium.org/251263004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -18 lines):
  M src/scanner.cc
  M src/string-stream.cc


Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index d09dbb9922e024a6e04015cf63a2ef1434ba4e6c..4ad0f4118dee769bd72c369532f38cea8b0b25bf 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -1095,19 +1095,13 @@ bool Scanner::ScanRegExpFlags() {

 Handle<String> Scanner::AllocateNextLiteralString(Isolate* isolate,
                                                   PretenureFlag tenured) {
-  MaybeHandle<String> maybe_result;
   if (is_next_literal_one_byte()) {
-    maybe_result = isolate->factory()->NewStringFromOneByte(
-        next_literal_one_byte_string(), tenured);
+    return isolate->factory()->NewStringFromOneByte(
+        next_literal_one_byte_string(), tenured).ToHandleChecked();
   } else {
-    maybe_result = isolate->factory()->NewStringFromTwoByte(
-        next_literal_two_byte_string(), tenured);
+    return isolate->factory()->NewStringFromTwoByte(
+        next_literal_two_byte_string(), tenured).ToHandleChecked();
   }
- // TODO(ishell): Temporarily returning null handle from here. I will proceed
-  // with maybehandlification in next CLs.
-  Handle<String> result;
-  if (!maybe_result.ToHandle(&result)) return Handle<String>();
-  return result;
 }


Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index e9795adde3653dacd29aad04ea115c4f91293418..25e340b4a563323f7a830ee73033161572906bb3 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -265,14 +265,8 @@ void StringStream::OutputToFile(FILE* out) {


 Handle<String> StringStream::ToString(Isolate* isolate) {
-  MaybeHandle<String> maybe_result = isolate->factory()->NewStringFromUtf8(
-      Vector<const char>(buffer_, length_));
-
- // TODO(ishell): Temporarily returning null handle from here. I will proceed
-  // with maybehandlification in next CLs.
-  Handle<String> result;
-  if (!maybe_result.ToHandle(&result)) return Handle<String>();
-  return result;
+  return isolate->factory()->NewStringFromUtf8(
+      Vector<const char>(buffer_, length_)).ToHandleChecked();
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to