Photoshop CC - Text Layer font size is not output correctly with javascript after image size has been changed.

Photoshop CC - Text Layer font size is not output correctly with javascript after image size has been changed.

Reproduce:
Create a document, any size (1024 for example.)
Create a text layer and insert some text.
Change text font size to something, i.e. 30.
Change image size to 50% (512), (meta + option + i)
Note that text size is cut in half (should be 15 if text was originally 30 for example.)
Using javascript, output the size (layer.textItem.size) of the text layer to a txt file.
Open the txt file and you will see that the size of the text layer was output as 30 in this example, it should have been 15.