get.js 391 B

123456789101112131415
  1. var cc = require("../");
  2. var chain = cc()
  3. , name = "forFun";
  4. chain
  5. .add({
  6. __sample:"for fun only"
  7. }, name)
  8. .on("load", function() {
  9. //It throw exception here
  10. console.log(chain.get("__sample", name));
  11. //But if I drop the name param, it run normally and return as expected: "for fun only"
  12. //console.log(chain.get("__sample"));
  13. });