You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to import momentjs library. When I use moment().format(), the library pass this to next function, but this is the object of JS-Interpreter and not momentjs. This is my test:
import moment from 'moment';
let myInterpreter = new Interpreter(condition, (interpreter: any, globalObject: any) => {});
myInterpreter.setValueToScope('moment', myInterpreter.nativeToPseudo(moment));
myInterpreter.run();
Momentjs code generating problem:
function format(inputString) {
if (!inputString) {
inputString = this.isUtc()
? hooks.defaultFormatUtc
: hooks.defaultFormat;
}
var output = formatMoment(this, inputString); // HERE is the problem
return this.localeData().postformat(output);
}
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] =
formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
The text was updated successfully, but these errors were encountered:
Can you restructure this as a complete example that runs (but, presumably, generates an error)? Specifically, in "this is my test", you don't specify a value for condition.
I'm trying to import momentjs library. When I use moment().format(), the library pass this to next function, but this is the object of JS-Interpreter and not momentjs. This is my test:
Momentjs code generating problem:
The text was updated successfully, but these errors were encountered: