This feels like something that the compiler should just call
Language.stringMatch and Language.stringSearch (or standalone
equivalents).  I'm not clear that we should always modify the string.  By
calling new utility functions, the developer has control over the
conversion.

-Alex

On 7/18/17, 4:11 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>The same issue applies to String.search(), although it might make sense
>to replace String.search() with String.indexOf() if the parameter is a
>string.
>
>> On Jul 18, 2017, at 12:36 PM, yishayw <yishayj...@hotmail.com> wrote:
>> 
>> In flash String.match() can take either a string or a regex. In JS it's
>> always considered to be a regex. So str.match("?") is valid in flash but
>> will fail in JS. We ran into that porting our app which includes some
>>code
>> to test for url params.
>> 
>> So maybe the compiler should identify that the input is a string and
>>replace
>> all special chars as suggested here [1]?
>> 
>> [1]
>> 
>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackove
>>rflow.com%2Fquestions%2F3561493%2Fis-there-a-regexp-escape-function-in-ja
>>vascript&data=02%7C01%7C%7C2260cdfd26d74274ba4a08d4cdcde8ea%7Cfa7b1b5a7b3
>>4438794aed2c178decee1%7C0%7C0%7C636359731646059595&sdata=LKSeBWNfrL6CCQRg
>>eMI48HJSvACdKoNp5X3AZuMoZeU%3D&reserved=0
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>>ex-development.2333347.n4.nabble.com%2FFlexJS-String-match-tp63392.html&d
>>ata=02%7C01%7C%7C2260cdfd26d74274ba4a08d4cdcde8ea%7Cfa7b1b5a7b34438794aed
>>2c178decee1%7C0%7C0%7C636359731646069605&sdata=X0ZlS9B3AUiglpM5ywHSi4aqui
>>jF55mWfBbbEfnJE6E%3D&reserved=0
>> Sent from the Apache Flex Development mailing list archive at
>>Nabble.com.
>

Reply via email to