tc39 / proposal-error-stacks

ECMAScript Proposal, specs, and reference implementation for Error.prototype.stack / System.getStack
https://tc39.github.io/proposal-error-stacks/
MIT License
170 stars 13 forks source link

Should FromStackFrameSpan(span) returns an object instead of an array? #17

Closed yungcheng closed 7 years ago

yungcheng commented 7 years ago

8.5 FromStackFrameSpan ( span ) returns an array and that's used in 8.4 FromStackFrame(frame) in step 8 Perform ! CreateDataProperty(obj, "span", ! FromStackFrameSpan(frame.[[Span]])).

Based on that, frame.[[Span]] would be an array instead of an object. That contradicts to 8.2 IsStackFrameSpan ( span ) step 1. If ! Type(span) is not Object, return false.

yungcheng commented 7 years ago

similar question for 8.6 FromStackFramePosition ( position )

ljharb commented 7 years ago

The algorithm for Type is such that arrays are Object: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values. "Array" is not a type.

yungcheng commented 7 years ago

Ah thanks for the reminder, forgot that Array isn't a type. Cool I'll close this issue then.