2016-11-01 18:38:43 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "JSCUtils.h"
|
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
2016-11-18 14:25:29 +00:00
|
|
|
String jsStringFromBigString(JSContextRef ctx, const JSBigString& bigstr) {
|
2016-11-01 18:38:43 +00:00
|
|
|
if (bigstr.isAscii()) {
|
2016-11-18 14:25:29 +00:00
|
|
|
return String::createExpectingAscii(ctx, bigstr.c_str(), bigstr.size());
|
2016-11-01 18:38:43 +00:00
|
|
|
} else {
|
2016-11-18 14:25:29 +00:00
|
|
|
return String(ctx, bigstr.c_str());
|
2016-11-01 18:38:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|