mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-31222 JSFile source member should not be a reference
This commit is contained in:
parent
fb4b207cdd
commit
8e5e2ece95
@ -8,8 +8,8 @@ def jsToHeader(target, source):
|
||||
|
||||
h = [
|
||||
'#include "mongo/base/string_data.h"',
|
||||
'#include "mongo/scripting/engine.h"',
|
||||
'namespace mongo {',
|
||||
'struct JSFile{ const char* name; const StringData& source; };',
|
||||
'namespace JSFiles{',
|
||||
]
|
||||
|
||||
@ -21,7 +21,7 @@ def jsToHeader(target, source):
|
||||
objname = os.path.split(filename)[1].split('.')[0]
|
||||
stringname = '_jscode_raw_' + objname
|
||||
|
||||
h.append('const char ' + stringname + "[] = {")
|
||||
h.append('constexpr char ' + stringname + "[] = {")
|
||||
|
||||
with open(filename, 'r') as f:
|
||||
for line in f:
|
||||
@ -30,8 +30,8 @@ def jsToHeader(target, source):
|
||||
h.append("0};")
|
||||
# symbols aren't exported w/o this
|
||||
h.append('extern const JSFile %s;' % objname)
|
||||
h.append('const JSFile %s = { "%s", StringData(%s) };' %
|
||||
(objname, filename.replace('\\', '/'), stringname))
|
||||
h.append('const JSFile %s = { "%s", StringData(%s, sizeof(%s) - 1) };' %
|
||||
(objname, filename.replace('\\', '/'), stringname, stringname))
|
||||
|
||||
h.append("} // namespace JSFiles")
|
||||
h.append("} // namespace mongo")
|
||||
|
@ -43,7 +43,7 @@ class OperationContext;
|
||||
|
||||
struct JSFile {
|
||||
const char* name;
|
||||
const StringData& source;
|
||||
const StringData source;
|
||||
};
|
||||
|
||||
class Scope {
|
||||
|
Loading…
Reference in New Issue
Block a user