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

Side by Side Diff: include/v8.h

Issue 6674034: Fix Array::New(length) in the API to return an array with the provided length. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 class Array : public Object { 1699 class Array : public Object {
1700 public: 1700 public:
1701 V8EXPORT uint32_t Length() const; 1701 V8EXPORT uint32_t Length() const;
1702 1702
1703 /** 1703 /**
1704 * Clones an element at index |index|. Returns an empty 1704 * Clones an element at index |index|. Returns an empty
1705 * handle if cloning fails (for any reason). 1705 * handle if cloning fails (for any reason).
1706 */ 1706 */
1707 V8EXPORT Local<Object> CloneElementAt(uint32_t index); 1707 V8EXPORT Local<Object> CloneElementAt(uint32_t index);
1708 1708
1709 /**
1710 * Creates a JavaScript array with the given length. If the length
1711 * is negative the returned array will have length 0.
1712 */
1709 V8EXPORT static Local<Array> New(int length = 0); 1713 V8EXPORT static Local<Array> New(int length = 0);
1714
1710 static inline Array* Cast(Value* obj); 1715 static inline Array* Cast(Value* obj);
1711 private: 1716 private:
1712 V8EXPORT Array(); 1717 V8EXPORT Array();
1713 static void CheckCast(Value* obj); 1718 static void CheckCast(Value* obj);
1714 }; 1719 };
1715 1720
1716 1721
1717 /** 1722 /**
1718 * A JavaScript function object (ECMA-262, 15.3). 1723 * A JavaScript function object (ECMA-262, 15.3).
1719 */ 1724 */
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 3871
3867 3872
3868 } // namespace v8 3873 } // namespace v8
3869 3874
3870 3875
3871 #undef V8EXPORT 3876 #undef V8EXPORT
3872 #undef TYPE_CHECK 3877 #undef TYPE_CHECK
3873 3878
3874 3879
3875 #endif // V8_H_ 3880 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698