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

Side by Side Diff: include/v8.h

Issue 867373003: Throw on range error when creating a string via API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 10 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
« 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 * Get the ExternalOneByteStringResource for an external one-byte string. 2126 * Get the ExternalOneByteStringResource for an external one-byte string.
2127 * Returns NULL if IsExternalOneByte() doesn't return true. 2127 * Returns NULL if IsExternalOneByte() doesn't return true.
2128 */ 2128 */
2129 const ExternalOneByteStringResource* GetExternalOneByteStringResource() const; 2129 const ExternalOneByteStringResource* GetExternalOneByteStringResource() const;
2130 2130
2131 V8_INLINE static String* Cast(v8::Value* obj); 2131 V8_INLINE static String* Cast(v8::Value* obj);
2132 2132
2133 enum NewStringType { kNormalString, kInternalizedString }; 2133 enum NewStringType { kNormalString, kInternalizedString };
2134 2134
2135 /** Allocates a new string from UTF-8 data.*/ 2135 /** Allocates a new string from UTF-8 data.*/
2136 static Local<String> NewFromUtf8(Isolate* isolate, 2136 static Local<String> NewFromUtf8(Isolate* isolate, const char* data,
2137 const char* data, 2137 NewStringType type = kNormalString,
2138 NewStringType type = kNormalString, 2138 int length = -1);
2139 int length = -1);
2140 2139
2141 /** Allocates a new string from Latin-1 data.*/ 2140 /** Allocates a new string from Latin-1 data.*/
2142 static Local<String> NewFromOneByte( 2141 static Local<String> NewFromOneByte(
2143 Isolate* isolate, 2142 Isolate* isolate,
2144 const uint8_t* data, 2143 const uint8_t* data,
2145 NewStringType type = kNormalString, 2144 NewStringType type = kNormalString,
2146 int length = -1); 2145 int length = -1);
2147 2146
2148 /** Allocates a new string from UTF-16 data.*/ 2147 /** Allocates a new string from UTF-16 data.*/
2149 static Local<String> NewFromTwoByte( 2148 static Local<String> NewFromTwoByte(
(...skipping 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after
7541 */ 7540 */
7542 7541
7543 7542
7544 } // namespace v8 7543 } // namespace v8
7545 7544
7546 7545
7547 #undef TYPE_CHECK 7546 #undef TYPE_CHECK
7548 7547
7549 7548
7550 #endif // V8_H_ 7549 #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