_st.js 561 B

1234567891011121314151617181920
  1. // !!! THIS FILE IS DEPRECATED !!!
  2. // Use as-receiver.js instead.
  3. /**
  4. * _st is a function used all over the compiled amber code that
  5. * takes any value (JavaScript or Smalltalk)
  6. * and returns a proper Amber Smalltalk receiver.
  7. *
  8. * null or undefined -> nil,
  9. * plain JS object -> wrapped JS object,
  10. * otherwise unchanged
  11. */
  12. define("amber_vm/_st", ["./globals", "./nil"], function (globals, nil) {
  13. return function (o) {
  14. if (o == null) { return nil; }
  15. if (o.klass) { return o; }
  16. return globals.JSObjectProxy._on_(o);
  17. };
  18. });