2016-11-01 11:38:43 -07:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "JSCUtils.h"
|
|
|
|
|
2018-04-20 06:31:26 -07:00
|
|
|
#include "RAMBundleRegistry.h"
|
|
|
|
|
2018-01-11 14:11:00 -08:00
|
|
|
#include <folly/Conv.h>
|
|
|
|
|
2016-11-01 11:38:43 -07:00
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
2016-11-18 06:25:29 -08:00
|
|
|
String jsStringFromBigString(JSContextRef ctx, const JSBigString& bigstr) {
|
2016-11-01 11:38:43 -07:00
|
|
|
if (bigstr.isAscii()) {
|
2016-11-18 06:25:29 -08:00
|
|
|
return String::createExpectingAscii(ctx, bigstr.c_str(), bigstr.size());
|
2016-11-01 11:38:43 -07:00
|
|
|
} else {
|
2016-11-18 06:25:29 -08:00
|
|
|
return String(ctx, bigstr.c_str());
|
2016-11-01 11:38:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|