fork download
  1. var modules = {};
  2.  
  3. function apply_to_B(instance) {
  4. "use strict";
  5. modules['B'] = instance.apply(instance,function() {
  6. function a() {
  7. console.log('aaaaaaaaaaaaaaaa');
  8. }
  9. return {
  10. a:a
  11. };
  12. });
  13. }
  14.  
  15. apply_to_B(function(mod) {
  16. "use strict";
  17. console.log(mod);
  18. function b() {
  19. mod.a();
  20. }
  21. return {
  22. b:b
  23. };
  24. });
  25.  
  26. let ret = modules['B'];
  27. ret.b();
Runtime error #stdin #stdout #stderr 0.3s 40192KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: uncaught JavaScript runtime exception: TypeError: second argument to Function.prototype.apply must be an array