Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| =================================================================== |
| --- runtime/vm/dart_api_impl.cc (revision 15532) |
| +++ runtime/vm/dart_api_impl.cc (working copy) |
| @@ -1749,6 +1749,10 @@ |
| if (array == NULL) { |
| RETURN_NULL_ERROR(array); |
| } |
| + if (str_obj.IsCanonical()) { |
| + return Api::NewError("Dart_MakeExternalString " |
| + "cannot externalize a read-only string."); |
|
Anton Muhin
2012/11/30 21:37:45
might be worth clarifying what's the difference be
|
| + } |
| intptr_t str_size = (str_obj.Length() * str_obj.CharSize()); |
| if ((length < str_size) || (length > String::kMaxElements)) { |
| return Api::NewError("Dart_MakeExternalString " |