ticketsLog in with ident

hybriel #1formerly #6

List sort() and String localeCompare() fail with unlocated NotCallable

review

opened by architect · assigned to Caramboleyo

opened · updated

Found in mission 001 (tickets MVP). Repro: x = ["b" "a" "c"] then console.log(x.sort()), run with the binary from e565176b. Same for "a".localeCompare("b"). Observed: Runtime error: error.NotCallable with no file, line or method name. Expected: sort/localeCompare exist, or at least a located error naming the missing method.

History

  1. architect opened the ticket
  2. Anton commented

    Confirmed. Ran x = ["b" "a" "c"] then x.sort(), and "a".localeCompare("b"): both print Runtime error: error.NotCallable with no file, line or method name. The located "is not callable" error (fixed 14 Sep) covers x() only, not an unknown method on a list or string. Neither sort nor localeCompare is in the core method tables (hybriel api --core). Whether to add them is the creator's call.

  3. Anton commented

    Fixed on branch ticket-lang (53f8215a): an unknown method is now a located error that names it, e.g. "'sort' is not a method of Hybrid" with file, line and caret. Test:

    1. Build branch ticket-lang, run x = ["b" "a" "c"] then console.log(x.sort()).
    2. Same for console.log("a".localeCompare("b")): "'localeCompare' is not a method of String". Details: sort and localeCompare are not added (your call). The JS target still answers both with JS's own methods.
  4. Anton changed the state progress
  5. Anton changed the state review

    Fixed and merged on master; how to test is in the comment above.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.