GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Missing methods from `SetIterator<T>` · Issue #1600 · TypeScriptToLua/TypeScriptToLua

Missing methods from SetIterator<T> #1600

New issue
Copy link
New issue
Copy link
Open
Open
Missing methods from SetIterator<T>#1600
Copy link
Labels
feature requestscope: language extensionsRelated to language-extension typesRelated to language-extension types

Description

@musjj
musjj
opened on Nov 21, 2024
Issue body actions
const a = ["foo", "bar"];
a.every((v) => typeof v === "string");

const b = new Set(["foo", "bar"]);
const values = b.values().toArray();
values.every((v) => typeof v === "string");

const c = new Set(["foo", "bar"]);
c.values().every((v) => typeof v === "string");

The code compiles to:

local ____lualib = require("lualib_bundle")
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
local Set = ____lualib.Set
local __TS__New = ____lualib.__TS__New
local ____exports = {}
local a = {"foo", "bar"}
__TS__ArrayEvery(
    a,
    function(____, v) return type(v) == "string" end
)
local b = __TS__New(Set, {"foo", "bar"})
local values = b:values():toArray()
__TS__ArrayEvery(
    values,
    function(____, v) return type(v) == "string" end
)
local c = __TS__New(Set, {"foo", "bar"})
c:values():every(function(____, v) return type(v) == "string" end)
return ____exports

Here, :toArray() and :every() is missing from the set iterator returned by :values(), causing a runtime error.

Reacted by Cold Fry

Activity

  1. Perryvw
    added
    feature request
    scope: language extensionsRelated to language-extension typesRelated to language-extension types
    on Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestscope: language extensionsRelated to language-extension typesRelated to language-extension types

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.