microsoft / pxt-adafruit

Microsoft MakeCode editor for Adafruit Circuit Playground Express
https://makecode.adafruit.com
Other
81 stars 77 forks source link

Block "list insert at beginning" doesn't show in tutorial example #1102

Closed Helen09 closed 5 years ago

Helen09 commented 5 years ago

Describe the bug Block "list insert at beginning" doesn't show in tutorial example

Steps to reproduce the behavior

  1. Navigate to https://makecode.adafruit.com/beta#editor
  2. Click "ADVANCED" -> "ARRAYS" -> right click on block "list insert at beginning"

Expected behavior Block "list insert at beginning" should show in tutorial example

Actual behavior Block "list insert at beginning" doesn't show in tutorial example image

Additional info:

  1. OS: Windows (rs6)
  2. Adafruit Circuit Playground Express version: 1.4.32
  3. Microsoft MakeCode version: 5.20.3
  4. codal-circuit-playground runtime version: v2.0.0
jwunderl commented 5 years ago

Issue is that unshift returns the new length of the array, so the example block needs a let myUnusedValue = in front of both unshifts.

Is the return value from unshift ever used? Seems like a really wonky behavior, but is true to actual javascript I suppose.

ganicke commented 5 years ago

Fixed in https://github.com/microsoft/pxt/pull/5837