diff --git a/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testHtml.st b/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testHtml.st index e5925fa01..03beff1f0 100644 --- a/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testHtml.st +++ b/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testHtml.st @@ -2,7 +2,7 @@ tests-creation testHtml self assert: (self jQuery html: [ :html | html div: 'foo' ]) - equals: self function , '("
foo
")'. + equals: self function , '("
foo<\/div>")'. self assert: (self jQuery html: [ :html | html div title: 'foo'; with: 'bar' ]) - equals: self function , '("
bar
")' \ No newline at end of file + equals: self function , '("
bar<\/div>")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testWithBlock.st b/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testWithBlock.st index b42d255ce..ae973addf 100644 --- a/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testWithBlock.st +++ b/repository/JQuery-Tests-Core.package/JQueryClassTest.class/instance/testWithBlock.st @@ -2,4 +2,4 @@ tests-with testWithBlock self assert: (self jQuery: [ :html | html heading: 'jQuery' ]) - equals: self function , '("

jQuery

")' \ No newline at end of file + equals: self function , '("

jQuery<\/h1>")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAfter.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAfter.st index 41e1ee65a..7c14e95a2 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAfter.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAfter.st @@ -2,7 +2,7 @@ tests-modifying testAfter self assert: ((self jQuery: 'p') after: [ :html | html strong: 'Hello' ]) - equals: self function , '("p").after("Hello")'. + equals: self function , '("p").after("Hello<\/strong>")'. self assert: ((self jQuery: 'span') insertAfter: '#foo') equals: self function , '("span").insertAfter("#foo")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAppend.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAppend.st index e77d9e1de..a14c632a6 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAppend.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testAppend.st @@ -2,7 +2,7 @@ tests-modifying testAppend self assert: ((self jQuery: 'p') append: [ :html | html strong: 'Hello' ]) - equals: self function , '("p").append("Hello")'. + equals: self function , '("p").append("Hello<\/strong>")'. self assert: ((self jQuery: 'span') appendTo: '#foo') equals: self function , '("span").appendTo("#foo")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testBefore.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testBefore.st index 7789c666c..29607fb69 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testBefore.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testBefore.st @@ -2,7 +2,7 @@ tests-modifying testBefore self assert: ((self jQuery: 'p') before: [ :html | html strong: 'Hello' ]) - equals: self function , '("p").before("Hello")'. + equals: self function , '("p").before("Hello<\/strong>")'. self assert: ((self jQuery: 'span') insertBefore: '#foo') equals: self function , '("span").insertBefore("#foo")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testHtml.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testHtml.st index 153bdff57..bcd8acd20 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testHtml.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testHtml.st @@ -5,4 +5,4 @@ testHtml equals: self function , '("div").html()'. self assert: ((self jQuery: 'div') html: [ :html | html div ]) - equals: self function , '("div").html("
")' \ No newline at end of file + equals: self function , '("div").html("
<\/div>")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testPrepend.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testPrepend.st index a60b69305..433ab838b 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testPrepend.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testPrepend.st @@ -2,7 +2,7 @@ tests-modifying testPrepend self assert: ((self jQuery: 'p') prepend: [ :html | html strong: 'Hello' ]) - equals: self function , '("p").prepend("Hello")'. + equals: self function , '("p").prepend("Hello<\/strong>")'. self assert: ((self jQuery: 'span') prependTo: '#foo') equals: self function , '("span").prependTo("#foo")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testReplace.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testReplace.st index 56b026cd2..403196953 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testReplace.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testReplace.st @@ -2,7 +2,7 @@ tests-modifying testReplace self assert: ((self jQuery: 'p') replaceWith: [ :html | html emphasis: 'Hello' ]) - equals: self function , '("p").replaceWith("Hello")'. + equals: self function , '("p").replaceWith("Hello<\/em>")'. self assert: ((self jQuery html: [ :html | html div: 'Hello' ]) replaceAll: '.foo') - equals: self function , '("
Hello
").replaceAll(".foo")' \ No newline at end of file + equals: self function , '("
Hello<\/div>").replaceAll(".foo")' \ No newline at end of file diff --git a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testWrap.st b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testWrap.st index 7f73e4134..4209038e4 100644 --- a/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testWrap.st +++ b/repository/JQuery-Tests-Core.package/JQueryInstanceTest.class/instance/testWrap.st @@ -2,10 +2,10 @@ tests-modifying testWrap self assert: ((self jQuery: 'p') wrap: [ :html | html strong ]) - equals: self function , '("p").wrap("")'. + equals: self function , '("p").wrap("<\/strong>")'. self assert: ((self jQuery: 'p') wrapAll: [ :html | html div ]) - equals: self function , '("p").wrapAll("
")'. + equals: self function , '("p").wrapAll("
<\/div>")'. self assert: ((self jQuery: 'p') wrapInner: [ :html | html span ]) - equals: self function , '("p").wrapInner("")' \ No newline at end of file + equals: self function , '("p").wrapInner("<\/span>")' \ No newline at end of file diff --git a/repository/Javascript-Core.package/JSStream.class/class/encodeString.on..st b/repository/Javascript-Core.package/JSStream.class/class/encodeString.on..st index 3c33285f1..da92869ac 100644 --- a/repository/Javascript-Core.package/JSStream.class/class/encodeString.on..st +++ b/repository/Javascript-Core.package/JSStream.class/class/encodeString.on..st @@ -1,15 +1,16 @@ encoding -encodeString: aString on: aStream +encodeString: aString on: aStream "Strings have a complicated encoding in Javascript, try to optimize their serialization." - + + | last | aStream nextPut: $". - 1 to: aString size do: [ :index | + 1 to: aString size do: [ :index | | char value encoded | char := aString at: index. value := char greaseInteger. - value < JavascriptCharacters size + value < JavascriptCharacters size ifFalse: [ - "U+2028 and U+2029 have to be treaded as new lines" + "U+2028 and U+2029 have to be treated as new lines" value = 16r2028 "Line separator" ifTrue: [ aStream nextPutAll: '\u2028' ] ifFalse: [ @@ -20,7 +21,12 @@ encodeString: aString on: aStream encoded := JavascriptCharacters at: value + 1. "we use nil markers becausee #isNil is faster than #isString because it's not actually sent" - encoded isNil - ifTrue: [ aStream nextPut: char ] - ifFalse: [ aStream nextPutAll: encoded ] ] ]. + encoded isNil + ifTrue: [ + "avoid that browsers mistakenly take the output as a closing tag" + (last = $< and: [ char = $/ ]) + ifTrue: [ aStream nextPutAll: '\/' ] + ifFalse: [ aStream nextPut: char ] ] + ifFalse: [ aStream nextPutAll: encoded ] ]. + last := char ]. aStream nextPut: $" \ No newline at end of file diff --git a/repository/Javascript-Core.package/ManifestJavascriptCore.class/README.md b/repository/Javascript-Core.package/ManifestJavascriptCore.class/README.md new file mode 100644 index 000000000..69df3deee --- /dev/null +++ b/repository/Javascript-Core.package/ManifestJavascriptCore.class/README.md @@ -0,0 +1 @@ +Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser \ No newline at end of file diff --git a/repository/Javascript-Core.package/ManifestJavascriptCore.class/class/ruleTempsReadBeforeWrittenRuleV1FalsePositive.st b/repository/Javascript-Core.package/ManifestJavascriptCore.class/class/ruleTempsReadBeforeWrittenRuleV1FalsePositive.st new file mode 100644 index 000000000..28e863376 --- /dev/null +++ b/repository/Javascript-Core.package/ManifestJavascriptCore.class/class/ruleTempsReadBeforeWrittenRuleV1FalsePositive.st @@ -0,0 +1,5 @@ +code-critics +ruleTempsReadBeforeWrittenRuleV1FalsePositive + + + ^ #(#(#(#RGMethodDefinition #(#'JSStream class' #encodeString:on: #true)) #'2023-09-27T18:22:24.916405+02:00') ) \ No newline at end of file diff --git a/repository/Javascript-Core.package/ManifestJavascriptCore.class/properties.json b/repository/Javascript-Core.package/ManifestJavascriptCore.class/properties.json new file mode 100644 index 000000000..7529dabf1 --- /dev/null +++ b/repository/Javascript-Core.package/ManifestJavascriptCore.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "PackageManifest", + "category" : "Javascript-Core-Manifest", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "ManifestJavascriptCore", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingInsert.st b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingInsert.st index 584d3f7f1..a1c81b58d 100644 --- a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingInsert.st +++ b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingInsert.st @@ -5,13 +5,13 @@ testModifyingInsert equals: '$(this).insert("1")'. self assert: (self element insertAfter: [ :r | r div ]) - equals: '$(this).insert({"after":"
"})'. + equals: '$(this).insert({"after":"
<\/div>"})'. self assert: (self element insertBefore: 'abc') equals: '$(this).insert({"before":"abc"})'. self assert: (self element insertTop: [ :r | r span: 5 ]) - equals: '$(this).insert({"top":"5"})'. + equals: '$(this).insert({"top":"5<\/span>"})'. self assert: (self element insertBottom: '5') equals: '$(this).insert({"bottom":"5"})' \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingReplace.st b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingReplace.st index bc41f1ecd..05ea9c48a 100644 --- a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingReplace.st +++ b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingReplace.st @@ -5,4 +5,4 @@ testModifyingReplace equals: '$(this).replace("foo")'. self assert: (self element replace: [ :r | r div id: 'foo' ]) - equals: '$(this).replace("
")' \ No newline at end of file + equals: '$(this).replace("
<\/div>")' \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingUpdate.st b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingUpdate.st index 2ba8dc3c4..26f2bbf87 100644 --- a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingUpdate.st +++ b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testModifyingUpdate.st @@ -5,4 +5,4 @@ testModifyingUpdate equals: '$("foo").update("bar")'. self assert: (self element update: [ :r | r div: 'bar' ]) - equals: '$(this).update("
bar
")' \ No newline at end of file + equals: '$(this).update("
bar<\/div>")' \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtml.st b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtml.st index 97d82ac46..612be1591 100644 --- a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtml.st +++ b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtml.st @@ -2,4 +2,4 @@ tests-rendering testRenderedHtml self assert: [ :html | html div script: (html scriptaculous element update: [ :r | r span ]) ] - renders: '
' \ No newline at end of file + renders: '
' \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtmlWithScripts.st b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtmlWithScripts.st index 9aa9ec122..081e950be 100644 --- a/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtmlWithScripts.st +++ b/repository/Prototype-Tests-Core.package/PTElementTest.class/instance/testRenderedHtmlWithScripts.st @@ -4,4 +4,4 @@ testRenderedHtmlWithScripts assert: [ :html | html div script: (html scriptaculous element remove). html div script: (html scriptaculous element update: [ :r | r span ]) ] - renders: '
' \ No newline at end of file + renders: '
' \ No newline at end of file diff --git a/repository/Prototype-Tests-Core.package/monticello.meta/version b/repository/Prototype-Tests-Core.package/monticello.meta/version deleted file mode 100644 index 5a0fe0be3..000000000 --- a/repository/Prototype-Tests-Core.package/monticello.meta/version +++ /dev/null @@ -1 +0,0 @@ -(name 'Prototype-Tests-Core-pmm.21' message '- fix test' id 'bfad35bc-5735-0d00-b128-7dde02b3bc31' date '24 October 2018' time '11:20:33.301536 am' author 'pmm' ancestors ((name 'Prototype-Tests-Core-pmm.20' message 'Add Prototype script generator - fixes #1026' id '558e804a-5735-0d00-b10a-603302b3bc31' date '24 October 2018' time '10:48:45.604612 am' author 'pmm' ancestors ((name 'Prototype-Tests-Core-pmm.19' message 'Add mapping to Prototype''s PeriodicalExecuter - fixes #925' id '558de728-e331-0d00-8e86-62c808033da6' date '10 September 2018' time '12:00:10.83962 pm' author 'pmm' ancestors ((name 'Prototype-Tests-Core-pmm.18' message 'Issue 822: Drop clever CDATA trick' id '64717be3-c73b-4e85-b16c-c322d1137294' date '23 August 2014' time '10:03:16 am' author 'pmm' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) \ No newline at end of file diff --git a/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/createHandlers.st b/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/createHandlers.st new file mode 100644 index 000000000..748fc16e1 --- /dev/null +++ b/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/createHandlers.st @@ -0,0 +1,4 @@ +configuration +createHandlers + + ^ Array with: WARequestHandler new \ No newline at end of file diff --git a/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/testNestedScripts.st b/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/testNestedScripts.st new file mode 100644 index 000000000..d65bf80ad --- /dev/null +++ b/repository/Seaside-Tests-Canvas.package/WADefaultScriptGeneratorTest.class/instance/testNestedScripts.st @@ -0,0 +1,12 @@ +testing +testNestedScripts + + self + assert: [ :html | + html anchor script: + ((html jQuery this closest: 'div') append: [ :r | + r div script: (html jQuery this + on: 'click' + selector: '.class' + do: (JSStream on: 'alert(''nested script''')) ]) ] + gives: '' \ No newline at end of file diff --git a/repository/Seaside-Tests-Canvas.package/WAScriptGeneratorTest.class/instance/assert.gives..st b/repository/Seaside-Tests-Canvas.package/WAScriptGeneratorTest.class/instance/assert.gives..st index 747634a1b..f314c5f5d 100644 --- a/repository/Seaside-Tests-Canvas.package/WAScriptGeneratorTest.class/instance/assert.gives..st +++ b/repository/Seaside-Tests-Canvas.package/WAScriptGeneratorTest.class/instance/assert.gives..st @@ -5,4 +5,4 @@ assert: aBlock gives: aString fullDocument: true; scriptGeneratorClass: self scriptGeneratorClass; render: aBlock. - self assert: aString = html \ No newline at end of file + self assert: aString equals: html \ No newline at end of file