Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Dead code removed; descriptive exception text #42

Closed
wants to merge 1 commit into from

2 participants

@victor-homyakov

Dead code removed (ticket #1316); descriptive exception text for cyclic object reference (ticket #1283)

@savetheclocktower
Collaborator

Closed because this change got applied through other means. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2012
  1. @victor-homyakov
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/prototype/lang/object.js
View
9 src/prototype/lang/object.js
@@ -161,8 +161,7 @@
}
function Str(key, holder, stack) {
- var value = holder[key],
- type = typeof value;
+ var value = holder[key];
if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
value = value.toJSON(key);
@@ -183,7 +182,7 @@
case false: return 'false';
}
- type = typeof value;
+ var type = typeof value;
switch (type) {
case 'string':
return value.inspect(true);
@@ -192,7 +191,9 @@
case 'object':
for (var i = 0, length = stack.length; i < length; i++) {
- if (stack[i] === value) { throw new TypeError(); }
+ if (stack[i] === value) {
+ throw new TypeError("Cyclic reference to '" + value + "' in object");
+ }
}
stack.push(value);
Something went wrong with that request. Please try again.