Gas スクリプト ファイルで Object.create を使用しようとしています。Object.create は定義されていますが、有用なオブジェクトを返していないようです。
function createOject() {
var o = Object.create({}, { p: { value: 42 } })
Logger.log(o.p); //logs 42.0 as expected
var db = ScriptDb.getMyDb();
db.save(o); //o still shows up as empty {} in the debugger and
//won't save to data store
showTable(); //logs nothing
}
このコードは正常に動作します:
function createOject() {
var o = {p: 42};
Logger.log(o.p); //logs 42.0 as expected
var db = ScriptDb.getMyDb();
db.save(o); //o shows up as an object {p: 42} in the debugger and
//saves to the the data store as expected
showTable(); //logs {p: 42} as expected
}
そのため、 Object.create が定義されていますが、期待どおりに機能していないようです。これはバグですか、それとも何か不足していますか?