diff --git a/packages/meteor/helpers.js b/packages/meteor/helpers.js index c358f85b15..a6791ad00d 100644 --- a/packages/meteor/helpers.js +++ b/packages/meteor/helpers.js @@ -37,6 +37,8 @@ _.extend(Meteor, { break; } obj = obj[key]; + if (typeof obj !== "object") + break; stack.push(obj); } diff --git a/packages/meteor/helpers_test.js b/packages/meteor/helpers_test.js index d44120619c..ec5afd3859 100644 --- a/packages/meteor/helpers_test.js +++ b/packages/meteor/helpers_test.js @@ -51,6 +51,14 @@ Tinytest.add("environment - helpers", function (test) { Meteor._delete(x, "a", "b", "c"); test.equal(x, {}); + x = {a: {b: 99}}; + Meteor._delete(x, "a", "b", "c", "d"); + test.equal(x, {}); + + x = {a: {b: 99}}; + Meteor._delete(x, "a", "b", "c", "d", "e", "f"); + test.equal(x, {}); + x = {a: {b: {c: {d: 99}}}, x: 12}; Meteor._delete(x, "a", "b", "c", "d"); test.equal(x, {x: 12}); diff --git a/packages/tinytest/tinytest.js b/packages/tinytest/tinytest.js index da8a3cc09f..606e2f1822 100644 --- a/packages/tinytest/tinytest.js +++ b/packages/tinytest/tinytest.js @@ -42,7 +42,7 @@ _.extend(TestCaseResults.prototype, { var now = (+new Date); debugger; if ((+new Date) - now < 100) - alert("To use this feature, first open the debugger window in your browser."); + alert("To use this feature, first enable your browser's debugger."); } self.stop_at_offset = null; }