Skip to content

Commit 634857c

Browse files
committed
Rename _gopherjs_overridden_ to _gopherjs_original_ for greater consistency
1 parent f9b66ec commit 634857c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build/build.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func ImportDir(dir string, mode build.ImportMode, installSuffix string, buildTag
128128
// as an existing file from the standard library). For function identifiers that exist
129129
// in the original AND the overrides AND that include the following directive in their comment:
130130
// //gopherjs:keep-original, the original identifier in the AST gets prefixed by
131-
// `_gopherjs_overridden_`. For other identifiers that exist in the original AND the overrides,
131+
// `_gopherjs_original_`. For other identifiers that exist in the original AND the overrides,
132132
// the original identifier gets replaced by `_`. New identifiers that don't exist in original
133133
// package get added.
134134
func parseAndAugment(xctx XContext, pkg *PackageData, isTest bool, fileSet *token.FileSet) ([]*ast.File, []JSFile, error) {
@@ -251,8 +251,8 @@ func parseAndAugment(xctx XContext, pkg *PackageData, isTest bool, fileSet *toke
251251
}
252252
if info.keepOriginal {
253253
// Allow overridden function calls
254-
// The standard library implementation of foo() becomes _gopherjs_overridden_foo()
255-
d.Name.Name = "_gopherjs_overridden_" + d.Name.Name
254+
// The standard library implementation of foo() becomes _gopherjs_original_foo()
255+
d.Name.Name = "_gopherjs_original_" + d.Name.Name
256256
} else {
257257
d.Name = ast.NewIdent("_")
258258
}

compiler/astutil/astutil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func PruneOriginal(d *ast.FuncDecl) bool {
100100
// applied to functions in native overlays and will instruct the augmentation
101101
// logic to expose the original function such that it can be called. For a
102102
// function in the original called `foo`, it will be accessible by the name
103-
// `_gopherjs_overridden_foo`.
103+
// `_gopherjs_original_foo`.
104104
func KeepOriginal(d *ast.FuncDecl) bool {
105105
if d.Doc == nil {
106106
return false

compiler/natives/src/regexp/regexp_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ func TestOnePassCutoff(t *testing.T) {
1616
}
1717
}()
1818

19-
_gopherjs_overridden_TestOnePassCutoff(t)
19+
_gopherjs_original_TestOnePassCutoff(t)
2020
}

0 commit comments

Comments
 (0)