Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Unified Diff: src/accessors.cc

Issue 2490903002: Simplify accesses to Script::line_ends (Closed)
Patch Set: Address comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.h ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 0e607c0e46c3636c2887df7b441cfd6a4c64c6c8..9ec24b84c7c586bd8c8c654d226af6c141e579d6 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -469,40 +469,6 @@ Handle<AccessorInfo> Accessors::ScriptCompilationTypeInfo(
//
-// Accessors::ScriptGetLineEnds
-//
-
-
-void Accessors::ScriptLineEndsGetter(
- v8::Local<v8::Name> name,
- const v8::PropertyCallbackInfo<v8::Value>& info) {
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
- HandleScope scope(isolate);
- Handle<Object> object = Utils::OpenHandle(*info.Holder());
- Handle<Script> script(
- Script::cast(Handle<JSValue>::cast(object)->value()), isolate);
- Script::InitLineEnds(script);
- DCHECK(script->line_ends()->IsFixedArray());
- Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
- // We do not want anyone to modify this array from JS.
- DCHECK(*line_ends == isolate->heap()->empty_fixed_array() ||
- line_ends->map() == isolate->heap()->fixed_cow_array_map());
- Handle<JSArray> js_array =
- isolate->factory()->NewJSArrayWithElements(line_ends);
- info.GetReturnValue().Set(Utils::ToLocal(js_array));
-}
-
-
-Handle<AccessorInfo> Accessors::ScriptLineEndsInfo(
- Isolate* isolate, PropertyAttributes attributes) {
- Handle<String> name(isolate->factory()->InternalizeOneByteString(
- STATIC_CHAR_VECTOR("line_ends")));
- return MakeAccessor(isolate, name, &ScriptLineEndsGetter, nullptr,
- attributes);
-}
-
-
-//
// Accessors::ScriptSourceUrl
//
« no previous file with comments | « src/accessors.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698