@@ -1014,7 +1014,6 @@ fn test_jsx_single_line() {
10141014}
10151015
10161016#[ test]
1017- #[ ignore]
10181017fn test_avoid_slash_script ( ) {
10191018 // Positive cases
10201019 test ( "x = '</script'" , "x = \" <\\ /script\" ;\n " ) ;
@@ -1027,36 +1026,23 @@ fn test_avoid_slash_script() {
10271026 test ( "x = `</ScRiPt`" , "x = `<\\ /ScRiPt`;\n " ) ;
10281027 test ( "x = `</script${y}`" , "x = `<\\ /script${y}`;\n " ) ;
10291028 test ( "x = `${y}</script`" , "x = `${y}<\\ /script`;\n " ) ;
1029+ test ( "x = `<</script`" , "x = `<<\\ /script`;\n " ) ;
1030+ test ( "x = `</</script`" , "x = `</<\\ /script`;\n " ) ;
10301031 test_minify ( "x = 1 < /script/.exec(y).length" , "x=1< /script/.exec(y).length;" ) ;
10311032 test_minify ( "x = 1 < /SCRIPT/.exec(y).length" , "x=1< /SCRIPT/.exec(y).length;" ) ;
10321033 test_minify ( "x = 1 < /ScRiPt/.exec(y).length" , "x=1< /ScRiPt/.exec(y).length;" ) ;
10331034 test_minify ( "x = 1 << /script/.exec(y).length" , "x=1<< /script/.exec(y).length;" ) ;
10341035 test ( "//! </script\n //! >/script\n //! /script" , "//! <\\ /script\n //! >/script\n //! /script\n " ) ;
10351036 test ( "//! </SCRIPT\n //! >/SCRIPT\n //! /SCRIPT" , "//! <\\ /SCRIPT\n //! >/SCRIPT\n //! /SCRIPT\n " ) ;
10361037 test ( "//! </ScRiPt\n //! >/ScRiPt\n //! /ScRiPt" , "//! <\\ /ScRiPt\n //! >/ScRiPt\n //! /ScRiPt\n " ) ;
1037- test ( "/*! </script \n </script */" , "/*! <\\ /script \n <\\ /script */\n " ) ;
1038- test ( "/*! </SCRIPT \n </SCRIPT */" , "/*! <\\ /SCRIPT \n <\\ /SCRIPT */\n " ) ;
1039- test ( "/*! </ScRiPt \n </ScRiPt */" , "/*! <\\ /ScRiPt \n <\\ /ScRiPt */\n " ) ;
1040- test (
1041- "String.raw`</script`" ,
1042- "import { __template } from \" <runtime>\" ;\n var _a;\n String.raw(_a || (_a = __template([\" <\\ /script\" ])));\n " ,
1043- ) ;
1044- test (
1045- "String.raw`</script${a}`" ,
1046- "import { __template } from \" <runtime>\" ;\n var _a;\n String.raw(_a || (_a = __template([\" <\\ /script\" , \" \" ])), a);\n " ,
1047- ) ;
1048- test (
1049- "String.raw`${a}</script`" ,
1050- "import { __template } from \" <runtime>\" ;\n var _a;\n String.raw(_a || (_a = __template([\" \" , \" <\\ /script\" ])), a);\n " ,
1051- ) ;
1052- test (
1053- "String.raw`</SCRIPT`" ,
1054- "import { __template } from \" <runtime>\" ;\n var _a;\n String.raw(_a || (_a = __template([\" <\\ /SCRIPT\" ])));\n " ,
1055- ) ;
1056- test (
1057- "String.raw`</ScRiPt`" ,
1058- "import { __template } from \" <runtime>\" ;\n var _a;\n String.raw(_a || (_a = __template([\" <\\ /ScRiPt\" ])));\n " ,
1059- ) ;
1038+ test ( "/*! </script \n </script */" , "/*! <\\ /script \n <\\ /script */" ) ;
1039+ test ( "/*! </SCRIPT \n </SCRIPT */" , "/*! <\\ /SCRIPT \n <\\ /SCRIPT */" ) ;
1040+ test ( "/*! </ScRiPt \n </ScRiPt */" , "/*! <\\ /ScRiPt \n <\\ /ScRiPt */" ) ;
1041+ test ( "String.raw`</script`" , "String.raw`<\\ /script`;\n " ) ;
1042+ test ( "String.raw`</script${a}`" , "String.raw`<\\ /script${a}`;\n " ) ;
1043+ test ( "String.raw`${a}</script`" , "String.raw`${a}<\\ /script`;\n " ) ;
1044+ test ( "String.raw`</SCRIPT`" , "String.raw`<\\ /SCRIPT`;\n " ) ;
1045+ test ( "String.raw`</ScRiPt`" , "String.raw`<\\ /ScRiPt`;\n " ) ;
10601046
10611047 // Negative cases
10621048 test ( "x = '</'" , "x = \" </\" ;\n " ) ;
0 commit comments