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

Unified Diff: src/api.cc

Issue 141044: A helper function to speed up creation of V8 wrappers for DOM Nodes. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 months 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 | « include/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
===================================================================
--- src/api.cc (revision 2242)
+++ src/api.cc (working copy)
@@ -3012,6 +3012,26 @@
}
+Local<Object> Array::CloneElementAt(uint32_t index) {
+ ON_BAILOUT("v8::Array::CloneElementAt()", return Local<Object>());
+ i::Handle<i::JSObject> self = Utils::OpenHandle(this);
+ if (!self->HasFastElements()) {
+ return Local<Object>();
+ }
+ i::FixedArray* elms = self->elements();
+ i::Object* paragon = elms->get(index);
+ if (!paragon->IsJSObject()) {
+ return Local<Object>();
+ }
+ i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
+ EXCEPTION_PREAMBLE();
+ i::Handle<i::JSObject> result = i::Copy(paragon_handle);
+ has_pending_exception = result.is_null();
+ EXCEPTION_BAILOUT_CHECK(Local<Object>());
+ return Utils::ToLocal(result);
+}
+
+
Local<String> v8::String::NewSymbol(const char* data, int length) {
EnsureInitialized("v8::String::NewSymbol()");
LOG_API("String::NewSymbol(char)");
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698