Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incorrect use of stale cached code #827

Copy link
Copy link
Open
@antong

Description

@antong
Issue body actions

Go 1.10.2 on Windows, GopherJS 1.10-4 (8dffc02)

Compiling using GOOS=linux gopherjs.exe ....

Assume the following package layout:

  • gojscache/gojscache.go : defines type Foo.
  • gojscache/factory/factory.go : constructs a *gojscache.Foo
  • gojscache/use/main.go: imports gojscache and gojscache/factory. Uses gojscache/factory to construct a *gojscache.Foo.

Now, when modifying the top package to add fields to Foo and rebuilding gojscache/use, Gopherjs doesn't rebuild gojscache/factory. This causes the constructor in gojscache/factory to erroneously omit the newly added fields in Foo, leading to errors such as:

..js:13680 Uncaught TypeError: Cannot read property 'constructor' of undefined
    at Object.$packages.reflect.Value.ptr.object (..js:13680)
    at valueInterface (reflect.go:677)
    at Object.$packages.reflect.Value.ptr.Interface (..js:15774)
    at Object.$packages.fmt.pp.ptr.printValue (print.go:699)
    at Object.$packages.fmt.pp.ptr.printValue (print.go:783)
    at Object.$packages.fmt.pp.ptr.printValue (print.go:853)
    at Object.$packages.fmt.pp.ptr.printArg (print.go:689)
    at Object.$packages.fmt.pp.ptr.doPrintln (print.go:1146)
    at Fprintln (print.go:254)
    at Object.Println (..js:17476)
    at main (main.go:11)
    at $init (..js:18826)
    at $goroutine (..js:1471)
    at $runScheduled (..js:1511)
    at $schedule (..js:1527)
    at $go (..js:1503)
    at ..js:18837
    at ..js:18840

This is fixed by #805 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixNeedsHelpCommunity contributions are welcome for this feature!Community contributions are welcome for this feature!bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.