Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

Can't run the user-script in Google Chrome in r204+ #4054

Closed thanhcuong90 closed 4 years ago

thanhcuong90 commented 4 years ago

Problem description

The user-script can't run on the GG Chrome browser in new C3 version r204+ (But the old version C3 e.g: r190 can)

Attach a .c3p

bugGGChrome.c3p.zip Here are the file .c3p with the script in side!

Steps to reproduce

  1. Start GG Chrome browser, go to C3 editor.construct.net
  2. Open Attach c3p file above.
  3. Start Game,
  4. Check Console Tab to verified that the user script can run

Observed result

The console in browser show message error: action.js:31 Unhandled exception running script Event sheet 1, event 1, action 1: Invalid board character encountered at index replaceAll: function replaceAll(find,replace){return this.replace(new RegExp(C3.EscapeRegex(find),"g"),()=>replace)}

which mean the user-scripting code can't run in Google Chrome browser. When I try C3 in Firefox then -> can be runs all the code

Expected result

The user-script can run the js code genboard sudoku

More details

Devices using to run code: MAC OS - Google Chrome, Firefox. WINDOWS 10 - google Chrome, Firefox.

Affected browsers/platforms: Try to run code Chrome on iPhone, Chrome on Android

First affected release: r204+

System details

View details
AshleyScirra commented 4 years ago

I'm afraid it's impossible to investigate reports like this. Please see the bug report guidelines, they're there to make sure we can help.

thanhcuong90 commented 4 years ago

Sorry about my bad English, it's not my mother language. So i try to typing it again ! So @AshleyScirra can you check this issue again ?!

AshleyScirra commented 4 years ago

It looks like a problem with the replaceAll() method which I had already fixed separately. It doesn't show that error in the development copy of Construct, so it should be fixed in the next release. Note however it still shows JavaScript errors in the console, because your JavaScript code doesn't work.