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

Side by Side Diff: vm/dart_api_impl.cc

Issue 11411341: Fix for issue 7089 (Symbols::New was not quite working correctly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | vm/double_conversion.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 Isolate* isolate = Isolate::Current(); 1555 Isolate* isolate = Isolate::Current();
1556 DARTSCOPE(isolate); 1556 DARTSCOPE(isolate);
1557 if (utf8_array == NULL && length != 0) { 1557 if (utf8_array == NULL && length != 0) {
1558 RETURN_NULL_ERROR(utf8_array); 1558 RETURN_NULL_ERROR(utf8_array);
1559 } 1559 }
1560 CHECK_LENGTH(length, String::kMaxElements); 1560 CHECK_LENGTH(length, String::kMaxElements);
1561 if (!Utf8::IsValid(utf8_array, length)) { 1561 if (!Utf8::IsValid(utf8_array, length)) {
1562 return Api::NewError("%s expects argument 'str' to be valid UTF-8.", 1562 return Api::NewError("%s expects argument 'str' to be valid UTF-8.",
1563 CURRENT_FUNC); 1563 CURRENT_FUNC);
1564 } 1564 }
1565 return Api::NewHandle(isolate, String::New(utf8_array, length)); 1565 return Api::NewHandle(isolate, String::FromUTF8(utf8_array, length));
1566 } 1566 }
1567 1567
1568 1568
1569 DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array, 1569 DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array,
1570 intptr_t length) { 1570 intptr_t length) {
1571 Isolate* isolate = Isolate::Current(); 1571 Isolate* isolate = Isolate::Current();
1572 DARTSCOPE(isolate); 1572 DARTSCOPE(isolate);
1573 if (utf16_array == NULL && length != 0) { 1573 if (utf16_array == NULL && length != 0) {
1574 RETURN_NULL_ERROR(utf16_array); 1574 RETURN_NULL_ERROR(utf16_array);
1575 } 1575 }
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4453 } 4453 }
4454 { 4454 {
4455 NoGCScope no_gc; 4455 NoGCScope no_gc;
4456 RawObject* raw_obj = obj.raw(); 4456 RawObject* raw_obj = obj.raw();
4457 isolate->heap()->SetPeer(raw_obj, peer); 4457 isolate->heap()->SetPeer(raw_obj, peer);
4458 } 4458 }
4459 return Api::Success(isolate); 4459 return Api::Success(isolate);
4460 } 4460 }
4461 4461
4462 } // namespace dart 4462 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/double_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698