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

Side by Side Diff: sky/engine/bindings/core/v8/V8PerContextData.cpp

Issue 688033003: Fix line numbers in JavaScript stack traces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove unnecessary Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 m_contextHolder->SetContext(context); 51 m_contextHolder->SetContext(context);
52 52
53 v8::Context::Scope contextScope(context); 53 v8::Context::Scope contextScope(context);
54 ASSERT(m_errorPrototype.isEmpty()); 54 ASSERT(m_errorPrototype.isEmpty());
55 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global ()->Get(v8AtomicString(m_isolate, "Error"))); 55 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global ()->Get(v8AtomicString(m_isolate, "Error")));
56 ASSERT(!object.IsEmpty()); 56 ASSERT(!object.IsEmpty());
57 v8::Handle<v8::Value> prototypeValue = object->Get(v8AtomicString(m_isolate, "prototype")); 57 v8::Handle<v8::Value> prototypeValue = object->Get(v8AtomicString(m_isolate, "prototype"));
58 ASSERT(!prototypeValue.IsEmpty()); 58 ASSERT(!prototypeValue.IsEmpty());
59 m_errorPrototype.set(m_isolate, prototypeValue); 59 m_errorPrototype.set(m_isolate, prototypeValue);
60
61 m_functionConstructor.set(m_isolate, v8::Handle<v8::Function>::Cast(context- >Global()->Get(v8AtomicString(m_isolate, "Function"))));
62 } 60 }
63 61
64 V8PerContextData::~V8PerContextData() 62 V8PerContextData::~V8PerContextData()
65 { 63 {
66 } 64 }
67 65
68 PassOwnPtr<V8PerContextData> V8PerContextData::create(v8::Handle<v8::Context> co ntext) 66 PassOwnPtr<V8PerContextData> V8PerContextData::create(v8::Handle<v8::Context> co ntext)
69 { 67 {
70 return adoptPtr(new V8PerContextData(context)); 68 return adoptPtr(new V8PerContextData(context));
71 } 69 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (!data->IsString()) 196 if (!data->IsString())
199 return -1; 197 return -1;
200 v8::String::Utf8Value utf8(data); 198 v8::String::Utf8Value utf8(data);
201 char* comma = strnstr(*utf8, ",", utf8.length()); 199 char* comma = strnstr(*utf8, ",", utf8.length());
202 if (!comma) 200 if (!comma)
203 return -1; 201 return -1;
204 return atoi(comma + 1); 202 return atoi(comma + 1);
205 } 203 }
206 204
207 } // namespace blink 205 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/V8PerContextData.h ('k') | sky/engine/bindings/core/v8/V8ScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698