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

Side by Side Diff: include/v8.h

Issue 16365008: ReturnValue::Set(uint32_t) is wrong (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-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 // 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 5664 matching lines...) Expand 10 before | Expand all | Expand 10 after
5675 if (V8_LIKELY(I::IsValidSmi(i))) { 5675 if (V8_LIKELY(I::IsValidSmi(i))) {
5676 *value_ = I::IntToSmi(i); 5676 *value_ = I::IntToSmi(i);
5677 return; 5677 return;
5678 } 5678 }
5679 Set(Integer::New(i, GetIsolate())); 5679 Set(Integer::New(i, GetIsolate()));
5680 } 5680 }
5681 5681
5682 template<typename T> 5682 template<typename T>
5683 void ReturnValue<T>::Set(uint32_t i) { 5683 void ReturnValue<T>::Set(uint32_t i) {
5684 typedef internal::Internals I; 5684 typedef internal::Internals I;
5685 if (V8_LIKELY(I::IsValidSmi(i))) { 5685 if (V8_LIKELY(i <= INT32_MAX)) {
5686 *value_ = I::IntToSmi(i); 5686 Set(static_cast<int32_t>(i));
5687 return; 5687 return;
5688 } 5688 }
5689 Set(Integer::NewFromUnsigned(i, GetIsolate())); 5689 Set(Integer::NewFromUnsigned(i, GetIsolate()));
5690 } 5690 }
5691 5691
5692 template<typename T> 5692 template<typename T>
5693 void ReturnValue<T>::Set(bool value) { 5693 void ReturnValue<T>::Set(bool value) {
5694 typedef internal::Internals I; 5694 typedef internal::Internals I;
5695 int root_index; 5695 int root_index;
5696 if (value) { 5696 if (value) {
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
6292 6292
6293 6293
6294 } // namespace v8 6294 } // namespace v8
6295 6295
6296 6296
6297 #undef V8EXPORT 6297 #undef V8EXPORT
6298 #undef TYPE_CHECK 6298 #undef TYPE_CHECK
6299 6299
6300 6300
6301 #endif // V8_H_ 6301 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698